-
-
Notifications
You must be signed in to change notification settings - Fork 332
Add support for Fast Stream Depends #898
New issue
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
Add support for Fast Stream Depends #898
Conversation
dad7b0f
to
575d0e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Falsy Dependency Extraction Fails
The _get_marker_from_parameter
function fails to extract falsy but valid dependencies (e.g., False
, 0
, ""
, or a falsy _Marker
) from Depends
wrappers. The if _marker := marker_extractor(marker):
line's implicit truthiness check prevents marker
from being updated when the extracted dependency is falsy. This leaves the original Depends
object, causing the subsequent isinstance(_Marker)
check to fail, unlike the previous implementation.
src/dependency_injector/wiring.py#L616-L620
python-dependency-injector/src/dependency_injector/wiring.py
Lines 616 to 620 in b414ef7
for marker_extractor in MARKER_EXTRACTORS: | |
if _marker := marker_extractor(marker): | |
marker = _marker | |
break |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Thanks for contribution! |
Inspired by PR 854. A slightly cleaner solution, where FastApi separated from Fast Stream properly. Even though they were together at some point, now Fast Stream - is a separate library after all.