-
Notifications
You must be signed in to change notification settings - Fork 267
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
Fix: dataclass
InitVar
s shouldn't be required on serialization
#1602
Conversation
CodSpeed Performance ReportMerging #1602 will not alter performanceComparing Summary
|
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.
We definitely need some kind of test for this change of behaviour!
We can manually build the core-schema, but we absolutely need a test or tests.
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.
otherwise I think LGTM.
) | ||
|
||
s = SchemaSerializer(schema) | ||
assert s.to_python(Foo(x=1), warnings='error') == {'x': 1} |
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.
please can you add a test with just the Foo
schema, and a test for Bar
here.
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.
and can you add a test for Foo(x=1, init_var=2)
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.
please can you add a test with just the Foo schema, and a test for Bar here.
Not quite sure what you mean here - I wasn't able to repro the issue without the union.
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.
I still it's still worth adding tests for the simplest cases.
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.
LGTM 👍
Fix pydantic/pydantic#11264