Skip to content
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

[ENG-4165] Consider default and default_factory for state vars #4510

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Dec 10, 2024

When determining whether a state var should be marked as optional, check that it is missing both default and default_factory and is not required.

Fix #4471

When determining whether a state var should be marked as optional, check that
it is missing both default and default_factory and is not required.

Fix #4471
Copy link

linear bot commented Dec 10, 2024

@benedikt-bartscher
Copy link
Contributor

Awesome @masenf thank you very much! Should I add a small test for this?
Also i found some other occurrences of this (only checking default, not default_factory), f.e. in get_attribute_access_type

@masenf
Copy link
Collaborator Author

masenf commented Dec 10, 2024

Should I add a small test for this?

yeah a test would be great to avoid future regression, thanks

@benedikt-bartscher
Copy link
Contributor

benedikt-bartscher commented Dec 10, 2024

@masenf I raised #4515 to merge in this PR
sadly, the CI does not run :/

@picklelo picklelo merged commit adfda8a into main Dec 12, 2024
33 checks passed
@picklelo picklelo deleted the masenf/default-factory branch December 12, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pydantic Field with rx.foreach on state broken
3 participants