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

Update deprecated call of general_plain_validator_function (#676) #897

Merged
merged 1 commit into from
May 1, 2024

Conversation

dslemusp
Copy link
Contributor

@dslemusp dslemusp commented Mar 15, 2024

@dslemusp dslemusp changed the title Update deprecated call of general_plain_validator_function Update deprecated call of general_plain_validator_function #676 Mar 15, 2024
@dslemusp dslemusp changed the title Update deprecated call of general_plain_validator_function #676 Update deprecated call of general_plain_validator_function (#676) Mar 15, 2024
@hasB4K
Copy link

hasB4K commented Mar 17, 2024

I would love this to merged! Most of my pytests warning on a project of mine are actually caused by this.

@roman-right, FYI, the deprecation was done by this PR: pydantic/pydantic-core#980
And I think this PR can be merged like this since others projects just did exactly what @dslemusp is doing in this PR (a simple function replacement, see: vitalik/django-ninja#922)

@roman-right
Copy link
Member

Hi @hasB4K ,

Thank you for following up. I'll pick it up at the beginning of the next week.

Comment on lines +417 to 419
return core_schema.with_info_plain_validator_function(
cls.build_validation(handler, source_type)
)
Copy link

Choose a reason for hiding this comment

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

I was reading the original code, and my IDE seems to complain that this code is unreachable.

Copy link
Contributor Author

@dslemusp dslemusp Mar 18, 2024

Choose a reason for hiding this comment

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

Yeah that was also my case but as my PR is only related to deprecation I only changed the deprecated calls. Perhaps this needs a separate PR.

@roman-right
Copy link
Member

It looks good. I plan to have it merged at this weekend

@roman-right roman-right merged commit 10cb0c0 into BeanieODM:main May 1, 2024
@roman-right
Copy link
Member

Merged. It will be published today

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.

4 participants