-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add support for complex pydantic models #208
Conversation
Codecov Report
@@ Coverage Diff @@
## master #208 +/- ##
=======================================
Coverage 99.91% 99.91%
=======================================
Files 44 44
Lines 2390 2399 +9
Branches 174 179 +5
=======================================
+ Hits 2388 2397 +9
Misses 2 2
Continue to review full report at Codecov.
|
1759c7e
to
34fac7a
Compare
@prkumar do I need to change something to get this merged? |
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.
@prkumar do I need to change something to get this merged?
The changes are causing tests to fail in py3.5 and py3.6: https://github.com/prkumar/uplink/pull/208/checks?check_run_id=1298280158. I mention some options of how we may address this in a separate comment:
To solve this, we can either do a try/catch around the code, or we can move this test into a separate file (e.g., test_converters_py37.py) and add some logic to have pytest skip that file when running against versions below 3.7: https://docs.pytest.org/en/latest/example/pythoncollection.html#customizing-test-collection
Other than that, these changes look good to me. However, I have a limited experience with using pydantic. Maybe @gmcrocetti may have some input, as the original contributor of uplink's Pydantic support in #200?
tests/unit/test_converters.py
Outdated
from typing import List | ||
|
||
class ComplexModel(pydantic.BaseModel): | ||
when: datetime = datetime.utcnow() |
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.
These annotations are causing tests to fail with py3.5 and py3.6 due to SyntaxError: https://github.com/prkumar/uplink/pull/208/checks?check_run_id=1298280158
To solve this, we can either do a try/catch around the code, or we can move this test into a separate file (e.g., test_converters_py37.py) and add some logic to have pytest skip that file when running against versions below 3.7: https://docs.pytest.org/en/latest/example/pythoncollection.html#customizing-test-collection
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.
I changed the test to use comment's annotation so it does not fail on python3.5.
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.
@prkumar I need this please, I'm tied to the old version of uplink without it.
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.
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.
@leiserfg - Changes were released yesterday with v0.9.3
34fac7a
to
0be222b
Compare
0be222b
to
4f8538a
Compare
Fixes #207
Attention: @prkumar