Skip to content
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

fix: correct dependency injection of custom context fields implementing partial __eq__/__ne__ #1809

Merged
merged 6 commits into from
Sep 25, 2024

Conversation

antoinehumbert
Copy link
Contributor

This PR fixes issue #1806

It includes 2 regression tests related to both corrections in faststream.utils.context.types for the 2 use cases where value is compared to EMPTY.

Note that the issue description is incorrect as the custom field class must implement __ne__ and not only __eq__ to trigger the problem. This is the reason for the User implementation provided in regression test.

Please, let me know if PR needs some improvements.

…custom field value implements __eq__/__ne__ returning NotImplemented
Lancetnik
Lancetnik previously approved these changes Sep 24, 2024
@Lancetnik Lancetnik added the bug Something isn't working label Sep 24, 2024
@Lancetnik
Copy link
Member

LGTM, thank you!

@antoinehumbert
Copy link
Contributor Author

Sorry for not executing the pre-commit check before submitting PR. Do you want me to correct those errors ?

examples/e12_custom_context.py Outdated Show resolved Hide resolved
Lancetnik
Lancetnik previously approved these changes Sep 24, 2024
@Lancetnik
Copy link
Member

@antoinehumbert can you run precommit please? 😄

@antoinehumbert
Copy link
Contributor Author

antoinehumbert commented Sep 24, 2024

Will do tomorrow. Sorry for the inconvinience.

@Lancetnik
Copy link
Member

Will do tomorrow. Sorry for the inconvinience.

Np! I am planning to make a release tomorrow. It will be great to see your fix in it

@antoinehumbert
Copy link
Contributor Author

Hi! Everything looks good now.

@Lancetnik Lancetnik added this pull request to the merge queue Sep 25, 2024
Merged via the queue into airtai:main with commit af92337 Sep 25, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants