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

Add test for functoool.partial validators #5102

Closed

Conversation

JensHeinrich
Copy link

Add testcase for #5101

JensHeinrich added 4 commits February 23, 2023 11:27
This fixes pydantic#5101 atleast in regards to the unhelpful message
As this check is only done on creation of a class the overhead should be ok
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

otherwise LGTM.

tests/test_validators.py Outdated Show resolved Hide resolved
@samuelcolvin
Copy link
Member

Also I see tests are failing.

Please update.

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

otherwise LGTM.

tests/test_validators.py Outdated Show resolved Hide resolved
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

LGTM, @dmontagu are you happy with this?

@dmontagu
Copy link
Contributor

Yes I'm fine with it.

If possible I think we should support functools validators in v2 (given my understanding of how validators will work in v2 though I think that should be straightforward).

JensHeinrich pushed a commit to JensHeinrich/pydantic that referenced this pull request Mar 1, 2023
JensHeinrich pushed a commit to JensHeinrich/pydantic that referenced this pull request Mar 1, 2023
@dmontagu
Copy link
Contributor

dmontagu commented Mar 8, 2023

Does it make sense to close this in favor of #5126 ?

@dmontagu dmontagu closed this Mar 8, 2023
dmontagu added a commit that referenced this pull request Mar 8, 2023
* Use getattr and default for qualname

Was suggested in python/cpython#102323 by @sobolevn.
Fixes #5101
Superceedes #5102

* Import tests from #5102

* Fix signature generation for functools

* Use getattr and default for name

* Remove expectation of error from tests

* Reset tracked validators

* Describe changes

* Use getattr and default for module

* Use id as fallback

* Tweak name formatting

---------

Co-authored-by: JensHeinrich <github.com/JensHeinrich>
Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
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.

None yet

3 participants