-
Notifications
You must be signed in to change notification settings - Fork 26
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 _get_type
- check for NoneType
#254
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more. @@ Coverage Diff @@
## v1 #254 +/- ##
=====================================
Coverage ? 92.34%
=====================================
Files ? 33
Lines ? 2039
Branches ? 0
=====================================
Hits ? 1883
Misses ? 156
Partials ? 0 |
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.
@dantownsend I can confirm that these changes are working as they should.
@sinisaos Thanks for checking 👍 Just added one more test, but seems to failing. |
@dantownsend Just an idea. If I use types.UnionType (because I think that Python 3.10 and above does not understand import types
if origin is t.Union or origin is types.UnionType:
# same as before the tests pass. |
@sinisaos Ah, great catch! I'll change it. |
* pydantic v2 support (#245) * pydantic_v2_support * pin to Piccolo v1 * add comment * remove KeyError Exception * upgrade coverage * fix type warnings with `nested` * fix mypy warnings * update black * replacement for `outer_type` * change assertion --------- Co-authored-by: Daniel Townsend <dan@dantownsend.co.uk> * update github actions * bumped version * fix `_get_type` - check for `NoneType` (#254) * fix `_get_type` - check for `NoneType` * add tests * fix typo * add a test for the new union syntax * also check for `UnionType` * bumped version * update JSON schema (#257) * bumped version * Update requirements.txt --------- Co-authored-by: sinisaos <sinisaos@gmail.com>
Related to #245 (comment)