Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Remove guarding check on computed field with field_serializer#10390
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
Remove guarding check on computed field with field_serializer#10390
Uh oh!
There was an error while loading.Please reload this page.
Conversation
please review |
codspeed-hqbot commentedSep 12, 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#10390 willnot alter performanceComparing Summary
|
github-actionsbot commentedSep 12, 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 |
tests/test_serialize.py Outdated
def two_x(self) -> int: | ||
return self.x * 2 | ||
@field_serializer('two_x') | ||
def ser_two_x_bad_signature(self, v, _info): |
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.
Should probably rename this - doesn't have a bad signature now.
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.
Can probably delete this test honestly - not sure of the value here anymore, especially given the other test added above.
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.
A few change requests, thanks!
tests/test_serialize.py Outdated
def two_x(self) -> int: | ||
return self.x * 2 | ||
@field_serializer('two_x') | ||
def ser_two_x_bad_signature(self, v, _info): |
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.
Can probably delete this test honestly - not sure of the value here anymore, especially given the other test added above.
LGTM overall - happy to merge after we fix up the tests a bit. Confirming with the team that there was no reason not to support this, before we merge as well. |
sydney-runkle commentedSep 12, 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.
See#6965 where this was added - there's some other relevant code that we should update. We can remove the |
@sydney-runkle removed. please review again.
|
Uh oh!
There was an error while loading.Please reload this page.
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.
Great work! Thanks so much@nix010!
656481f
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
Remove guarding check on computed field with field_serializer
Related issue number
#9683
Checklist
Selected Reviewer:@sydney-runkle