Closed itssimon closed 6 months ago
Since the algorithm we implemented in the taskiq-dependencies is completely different to fastapi's DI, there would be no hints for fixing it. But I will debug this issue.
Now everything should work fine with from __future__ import annotations
for python versions >= 3.10. Please update the taskiq-dependencies package to version 1.5.0 and verify.
If that works for you, consider closing the issue.
That works. Thank you!
When using the
Annotated
syntax for Taskiq dependencies and having thefrom __future__ import annotations
import at the top of the file, dependency injection doesn't work. An error like below will be thrown:I can imagine that this may be expected, so I'd suggest adding a note in the documentation so people don't waste as much time debugging this like I just did :)
Otherwise, maybe there is a clue in FastAPI on how to make it work even with the import from
__future__
?