Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Addlen
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codspeed-hqbot commentedDec 13, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#11111 willnot alter performanceComparing Summary
|
github-actionsbot commentedDec 13, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Coverage reportClick to see where and how coverage changed
This report was generated bypython-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 tolen(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 :)
Kharianne commentedDec 16, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
No problem! :-) The self._url is a type Url from pydantic-core and this class is not of type Sized - not havinglen. 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. |
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 topydantic-core
eventually...
de50a9e
intopydantic:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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