Repository navigation
Fix: dataclass InitVars shouldn't be required on serialization - #1602
Conversation
CodSpeed Performance ReportMerging #1602 will not alter performanceComparing Summary
|
samuelcolvin
left a comment
There was a problem hiding this comment.
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.
| ) | ||
|
|
||
| s = SchemaSerializer(schema) | ||
| assert s.to_python(Foo(x=1), warnings='error') == {'x': 1} |
There was a problem hiding this comment.
please can you add a test with just the Foo schema, and a test for Bar here.
There was a problem hiding this comment.
and can you add a test for Foo(x=1, init_var=2)
There was a problem hiding this comment.
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.
I still it's still worth adding tests for the simplest cases.
…ydantic/pydantic-core#1602) Original-commit-hash: 261c7ab
Fix pydantic/pydantic#11264