You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! Awesome library overall, but after upgrading to version 1.0 I am facing an issue with returning pydantic Models from tasks.
Due to the change here what happens now, is that my pydantic model is returned as dict, not a serialized model, i.e.:
result=awaittask.wait_result()
print(type(result.return_value)) # dict here
One side note that might be causing troubles -- maybe I have an edge case, but I have two packages where one contains the taskiq tasks and the broker and a separate client app (FastAPI) that calls these tasks, therefore because the redis credentials or the redis url can be different depending on whether running taskiq or the client app, I had to create a function that would accept parameters and create a broker.
I have something as following in my Taskiq tasks app:
Hey! Awesome library overall, but after upgrading to version 1.0 I am facing an issue with returning pydantic Models from tasks.
Due to the change here what happens now, is that my pydantic model is returned as
dict
, not a serialized model, i.e.:One side note that might be causing troubles -- maybe I have an edge case, but I have two packages where one contains the taskiq tasks and the broker and a separate client app (FastAPI) that calls these tasks, therefore because the redis credentials or the redis url can be different depending on whether running taskiq or the client app, I had to create a function that would accept parameters and create a broker.
I have something as following in my Taskiq tasks app:
ml_models/tasks.py
ml_models/taskiq.py
and then in the FastAPI app I am calling the tasks as following:
As a temporary fix, I had to subclass RedisAsyncResultBackend as following
The text was updated successfully, but these errors were encountered: