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
Change schema frozenset #1560
Change schema frozenset #1560
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1560 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 3793 3796 +3
Branches 752 752
=========================================
+ Hits 3793 3796 +3
Continue to review full report at Codecov.
|
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 add tests.
changes/1557-wangpeibao.md
Outdated
change schema.py/field_class_to_schema | ||
add frozenset type to the tuple |
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.
change schema.py/field_class_to_schema | |
add frozenset type to the tuple | |
change `schema.field_class_to_schema` to support `frozenset` in schema. |
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.
Sorry, I do not know how to add 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.
you need to commit this suggested change.
Look at |
changes/1557-wangpeibao.md
Outdated
change schema.py/field_class_to_schema | ||
add frozenset type to the tuple |
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.
you need to commit this suggested change.
@@ -1837,7 +1837,10 @@ class Model(BaseModel): | |||
def test_frozen_set(): | |||
class Model(BaseModel): | |||
a: FrozenSet[int] = frozenset({1, 2, 3}) | |||
b: FrozenSet = frozenset({1, 2, 3}) | |||
c: frozenset = frozenset({1, 2, 3}) |
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.
c: frozenset = frozenset({1, 2, 3}) | |
c: frozenset = frozenset({1, 2, 3}) | |
d: frozenset = ... |
Just to check the case when there's no default (obviously you'll need to change the check below too.
thank you so much. |
Change Summary
add one type(frozenset) to schema.py/field_class_to_schema
Related issue number
fix #1557
Checklist
changes/<pull request or issue id>-<github username>.md
file added describing change(see changes/README.md for details)