-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add len
to _BaseUrl
to avoid TypeError
#11111
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
Conversation
CodSpeed Performance ReportMerging #11111 will not alter performanceComparing Summary
|
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I think we can just to len(self._url)
in the __len__
check.
Could you also please add this fix to _BaseMultiHostUrl
and add a test for that as well?
We'll get this into our patch release tomorrow :)
No problem! :-) The self._url is a type Url from pydantic-core and this class is not of type Sized - not having len. Maybe this should be fixed in pydantic-core? Edit: I added the fix to _BaseMultiHostUrl as well + test. But let me know if the fix should be here or in core. |
6f7ca19
to
6149769
Compare
Hmm yeah, this makes sense I guess, we used to be able to apply directly to the core schema, and now we have this complex wrapped type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests! Looks good for now.
We can move the __len__
support to pydantic-core
eventually...
Change Summary
Add magic method to _BaseUrl class to support allowed usage of Field with max length with AnyUrl and simple length comparison and checks of AnyUrl types.
Related issue number
fix #11092
Checklist
Selected Reviewer: @sydney-runkle