We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug deserialize_callable is not working for local files that are not included in sys.modules
deserialize_callable
sys.modules
Error message
haystack.core.errors.DeserializationError: Could not locate the module of the callable: app.components.c4610c22_3b58_47c2_ba7f_33923bdc662f
Expected behavior deserialize_callable should respect local imports (from app.components.c4610c22_3b58_47c2_ba7f_33923bdc662f import my_function)
from app.components.c4610c22_3b58_47c2_ba7f_33923bdc662f import my_function
Additional context
To Reproduce Deserialize a local function using deserialize_callable
FAQ Check
System: Irrelevant
The text was updated successfully, but these errors were encountered:
Hey!
Can you provide a simple example so that I can reproduce the problem?
Sorry, something went wrong.
@anakin87
mkdir temp cd temp echo "def foo(): return 0" >> example_callable.py echo "from haystack.utils.callable_serialization import deserialize_callable; deserialize_callable('example_callable.foo')" >> test.py python test.py
This would fail the deserialization (don't use IDEs since they take care of modules and PYTHONPATH automatically)
haystack.core.errors.DeserializationError: Could not locate the module of the callable: example_callable
Successfully merging a pull request may close this issue.
Describe the bug
deserialize_callable
is not working for local files that are not included insys.modules
Error message
Expected behavior
deserialize_callable
should respect local imports (from app.components.c4610c22_3b58_47c2_ba7f_33923bdc662f import my_function
)Additional context
To Reproduce
Deserialize a local function using deserialize_callable
FAQ Check
System:
Irrelevant
The text was updated successfully, but these errors were encountered: