-
Notifications
You must be signed in to change notification settings - Fork 27
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 for issue 137 - cannot compare between <type> and None when sorting fields #190
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #190 +/- ##
==========================================
- Coverage 95.86% 95.79% -0.07%
==========================================
Files 12 12
Lines 1040 1095 +55
==========================================
+ Hits 997 1049 +52
- Misses 43 46 +3 ☔ View full report in Codecov by Sentry. |
Hmmm... I see lots of failed tests around
At first glance, I don't see how my change could have caused this error, but please advise. |
@j-carson Thanks for your continuous contributions! The |
Caught up to main. |
Erdantic requires (py)graphviz to be installed on your system. This can be tricky, especially on windows. See here for more. |
As mentioned in #137, we will require test cases to reliably fix the incorrect behaviour. If you need any support setting up tests with autodoc_pydantic please let me know. Testing sphinx extensions are not trivial. I'm more than happy to set up the test case given a minimal reproducible example. |
I installed graphviz, but pygrahviz is just giving me fits. I see that there is a |
I had to look up the correct invocation for tox, too. You can list all available environments defined in the |
I added a test case that at least covers the incorrect sorting behavior with inherited models. |
@j-carson Thx for putting all this effort in this PR and sorry for letting you wait for so long. I will review your PR in the next days. |
@j-carson Once again thanks a lot for the work you've put into this PR! I merged main and added several tests that explicitly test inheritance, also including overwriting fields of parent classes because this seemed to be a relevant edge case, too. By the way, you've actually fixed a bug that incorrectly showed/hided validators from the documentation. However, this bug has not been reported yet. The tests now cover the correct behavior. Additionally, you've fixed #178, too. Great work! I'm not completely done with the PR yet while I need to update the changelog and review some more tests. |
Interestingly, the edge case for python < 3.10 only occurs if the child class does not have any fields. In contrast, if the child class has at least a single field defined, the incorrect behavior disappears. See here. |
Hello,
I think I have a proposed fix for #137. However, I am having problems running the tox tests due to problems with erdantic.
I have tried
but it is still failing on trying to install erdantic and not finding include files for that.
Please suggest workaround?