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 annotated_types.MaxLen validator for custom sequence types #6809

Merged
merged 3 commits into from Jul 24, 2023

Conversation

ImogenBits
Copy link
Contributor

@ImogenBits ImogenBits commented Jul 22, 2023

Change Summary

Makes the validator function used for annotated_types.MaxLen with custom sequences use an inclusive upper bound.

Related issue number

fix #6808

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @dmontagu

@ImogenBits
Copy link
Contributor Author

please review

didn't add any unit tests as I'm not sure where they would go, can't find any similar ones.

@hramezani
Copy link
Member

Thanks @ImogenBits for this patch 👍

didn't add any unit tests as I'm not sure where they would go, can't find any similar ones.

You can adjust the test in

def test_constraints_arbitrary_type() -> None:

please update

@hramezani
Copy link
Member

please review

@hramezani
Copy link
Member

Please review

@samuelcolvin samuelcolvin enabled auto-merge (squash) July 24, 2023 20:00
@samuelcolvin samuelcolvin merged commit 9fe3802 into pydantic:main Jul 24, 2023
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MaxLen annotation validator for custom sequences is incorrect
4 participants