Skip to content

✨ Support merging FieldInfo values from multiple Field objects #1281

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ryangalamb
Copy link

Fixes #1278

@ryangalamb ryangalamb changed the title Support merging sqlmodel FieldInfos in Annotated [WIP] Support merging sqlmodel FieldInfos in Annotated Jan 28, 2025
field_infos.append(default_field_info)

# HACK: Quick and dirty way of merging into a new sqlmodel.FieldInfo object.
with mock.patch("pydantic.fields.FieldInfo", FieldInfo):
Copy link
Author

Choose a reason for hiding this comment

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

This call to mock.patch is no longer necessary. I'll implement the merging logic in sqlmodel before marking this PR as ready.

(I wanted to get feedback on the overall approach before taking the time to re-implement the pydantic logic.)

@svlandeg svlandeg added the feature New feature or request label Feb 20, 2025
@svlandeg svlandeg changed the title [WIP] Support merging sqlmodel FieldInfos in Annotated ✨ Support merging FieldInfo values from multiple Pydantic Field objects Feb 20, 2025
@svlandeg svlandeg changed the title ✨ Support merging FieldInfo values from multiple Pydantic Field objects ✨ Support merging FieldInfo values from multiple Field objects Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants