8000 Move `deque` schema gen to `GenerateSchema` class by sydney-runkle · Pull Request #11239 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content

Move deque schema gen to GenerateSchema class #11239

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

Merged
merged 3 commits into from
Jan 9, 2025
Merged

Conversation

sydney-runkle
Copy link
Contributor
@sydney-runkle sydney-runkle commented Jan 8, 2025

Follow up to #10846

See the description of that PR for more detail.

One consequence here is slightly different behavior for maxlen being set for deque types, but I think this is worth the significant simplification in internal logic we see here.

max_length constraints are still enforced, but we no longer monkeypatch the maxlen from max_length on the deque. If users want this, they should write a custom validator.

I'll be writing an in depth explanation of changes in the changelog for v2.11 related to this PR sequence.

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Jan 8, 2025
Copy link
codspeed-hq bot commented Jan 8, 2025

CodSpeed Performance Report

Merging #11239 will not alter performance

Comparing remove-deq-prep-anns (34193ea) with main (8fc509d)

Summary

✅ 46 untouched benchmarks

Copy link
cloudflare-workers-and-pages bot commented Jan 8, 2025

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 34193ea
Status: ✅  Deploy successful!
Preview URL: https://f9fb4ec4.pydantic-docs.pages.dev
Branch Preview URL: https://remove-deq-prep-anns.pydantic-docs.pages.dev

View logs

@sydney-runkle sydney-runkle added third-party-tests Add this label on a PR to trigger 3rd party tests and removed third-party-tests 8000 Add this label on a PR to trigger 3rd party tests labels Jan 8, 2025
Copy link
Contributor
github-actions bot commented Jan 8, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic/_internal
  _generate_schema.py
  _validators.py
Project Total  

This report was generated by python-coverage-comment-action

@sydney-runkle
Copy link
Contributor Author

cc @adriangb, more progress on simplifying logic here :)

No need for a review, but wanted to let you know.

@sydney-runkle sydney-runkle requested a review from Viicos January 9, 2025 18:55
Copy link
Member
@Viicos Viicos left a comment

Choose a reason for hiding this comment

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

Great

The fact that we can't access the metadata anymore to set the maxlen attribute shows a limitation of the current API, I'll maybe include it in my write up

@sydney-runkle
Copy link
Contributor Author

The fact that we can't access the metadata anymore to set the maxlen attribute shows a limitation of the current API, I'll maybe include it in my write up.

I'm not opposed to allowing metadata access, though this opens a can of worms in terms of consistency with annotation application.

@sydney-runkle sydney-runkle merged commit 4e055d5 into main Jan 9, 2025
61 checks passed
@sydney-runkle sydney-runkle deleted the remove-deq-prep-anns branch January 9, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes-fix Used for bugfixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0