-
-
Notifications
You must be signed in to change notification settings - Fork 2.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 our terms of service and privacy 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
Conversation
please review |
CodSpeed Performance ReportMerging #10390 will not alter performanceComparing Summary
|
Coverage reportClick to see where and how coverage changed
This report was generated by python-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. |
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.
|
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!
Change Summary
Remove guarding check on computed field with field_serializer
Related issue number
#9683
Checklist
Selected Reviewer: @sydney-runkle