Skip to content

Update pydantic #593

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 4 commits into from
Apr 17, 2025
Merged

Update pydantic #593

merged 4 commits into from
Apr 17, 2025

Conversation

hramezani
Copy link
Member

Fixes #592 , #591

@musicinmybrain
Copy link
Contributor

Thanks! Do any of these other occurrences of settings_cls.model_fields, model.model_fields, or similar need to be updated, too? (I honestly haven’t studied the code enough to know the answer.)

root_annotation = annotation.model_fields['root'].annotation

return model_cls.model_fields

for field_name, field_info in settings_cls.model_fields.items():

for sub_model_field_name, f in annotation.model_fields.items():

for field_name, field in self.settings_cls.model_fields.items():

for field_name in self.settings_cls.model_fields.keys()

assert Settings.model_fields['bar'].alias is None
assert Settings.model_fields['bar'].validation_alias is None
assert Settings.model_fields['foo'].alias is None
assert Settings.model_fields['foo'].validation_alias == 'foo_env'

assert SubSettings.model_fields['bar'].alias is None
assert SubSettings.model_fields['bar'].validation_alias is None
assert SubSettings.model_fields['foo'].alias is None
assert SubSettings.model_fields['foo'].validation_alias == 'foo_env'

for field_name, field in self.settings_cls.model_fields.items():

A similar construction also appears in documentation:

for field_name, field in self.settings_cls.model_fields.items():

Copy link
Contributor

hyperlint-ai bot commented Apr 16, 2025

PR Change Summary

Updated the Pydantic library to address specific issues related to field handling in settings classes.

Modified Files

  • docs/index.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@hramezani hramezani force-pushed the update-pydantic branch 2 times, most recently from 3d7d85e to c2e3804 Compare April 16, 2025 14:50
@hramezani hramezani requested a review from Viicos April 16, 2025 14:57
@hramezani
Copy link
Member Author

Thanks @Viicos for the review. I only changed the ones that throw warning

@hramezani hramezani merged commit f3e5ac3 into main Apr 17, 2025
18 checks passed
@hramezani hramezani deleted the update-pydantic branch April 17, 2025 11:41
@hramezani
Copy link
Member Author

Thanks @Viicos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some test regressions with Pydantic 2.11
3 participants