Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix:dataclassInitVars shouldn't be required on serialization#1602

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

Merged
davidhewitt merged 14 commits intomainfromfix-initvar-required
Jan 23, 2025

Conversation

sydney-runkle
Copy link
Contributor

@sydney-runklesydney-runkle commentedJan 21, 2025
edited
Loading

@codspeed-hqCodSpeed HQ
Copy link

codspeed-hqbot commentedJan 21, 2025
edited
Loading

CodSpeed Performance Report

Merging#1602 willnot alter performance

Comparingfix-initvar-required (3e82624) withmain (b426cce)

Summary

✅ 157 untouched benchmarks

@sydney-runklesydney-runkle marked this pull request as ready for reviewJanuary 21, 2025 18:53
Copy link
Member

@samuelcolvinsamuelcolvin left a 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.

Copy link
Member

@samuelcolvinsamuelcolvin left a 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}
Copy link
Member

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 theFoo schema, and a test forBar here.

Copy link
Member

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 forFoo(x=1, init_var=2)

sydney-runkle reacted with thumbs up emoji
Copy link
ContributorAuthor

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.

Copy link
Member

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.

Copy link
Contributor

@davidhewittdavidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM 👍

@davidhewittdavidhewitt merged commit261c7ab intomainJan 23, 2025
29 checks passed
@davidhewittdavidhewitt deleted the fix-initvar-required branchJanuary 23, 2025 19:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@davidhewittdavidhewittdavidhewitt approved these changes

@samuelcolvinsamuelcolvinAwaiting requested review from samuelcolvin

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Dataclass withInitVar andUnion gives warning during serialization
3 participants
@sydney-runkle@davidhewitt@samuelcolvin

[8]ページ先頭

©2009-2025 Movatter.jp