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

🐛 Allow_inf_nan option for Param subclasses #11579

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pat-lasswell
Copy link

@pat-lasswell pat-lasswell commented May 15, 2024

There was a typo in the __init__ method of the Param class which misnamed the allow_inf_nan option in the kwargs passed to the underlying Pydantic FieldInfo initializer. This resulted in the validator failing to enforce the constraint, and hence inf and nan values were being passed to the route handler when they should not have.

See #11577 for the original question.

pat-lasswell and others added 2 commits May 15, 2024 06:53
There was a typo in the __init__ method of the Param class which
misnamed the allow_inf_nan option in the kwargs passed to the
underlying Pydantic FieldInfo initializer.  This resulted in the
validator failing to enforce the constraint, and hence inf and nan
values being passed to the route handler where they should not have.
@Kludex
Copy link
Sponsor Collaborator

Kludex commented May 15, 2024

@pat-lasswell
Copy link
Author

I just noticed that I put the test file in the root rather in the tests directory. I pushed a commit to fix that.

Copy link
Contributor

@iudeen iudeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@oandersonmagalhaes oandersonmagalhaes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@alejsdev alejsdev added bug Something isn't working p2 labels Jun 19, 2024
@alejsdev alejsdev changed the title fix: allow_inf_nan option for Param subclasses 🐛 Allow_inf_nan option for Param subclasses Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants