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

fix get_given_constraint_keys for pydantic 2.1 #170

Merged
merged 15 commits into from Aug 1, 2023

Conversation

jerryjiahaha
Copy link

workaround for #169

Copy link
Owner

@mansenfranzen mansenfranzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for providing the PR to fix this bug!

We will need a test case to ensure the bug is fixed and won't occur again in the future. Since setting up tests with sphinx/pydantic is not trivial, feel free to allow me to contribute to your PR branch and I'm happy to add the test case.

Apart from that, I'm curious to know how you came up with this solution. Do you have some additional knowledge/docs about how __pydantic_core_schema__["definitions"] behaves? Of course it would be best to open an issue in the pydantic project asking for clarification in the first place but maybe you have some insights here.

@jerryjiahaha
Copy link
Author

@mansenfranzen Sorry, I don't know more about __pydantic_core_schema__ design... So I think this PR is temporary modification

__pydantic_core_schema__ may be an internal data structure of pydantic and may not be stable? (Ref: get_pydantic_core_schema doc )

@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 19:30 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 19:30 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 19:30 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 19:30 — with GitHub Actions Inactive
@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.29% 🎉

Comparison is base (6d40446) 94.39% compared to head (94e979f) 94.68%.

❗ Current head 94e979f differs from pull request most recent head afe28cb. Consider uploading reports for the commit afe28cb to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
+ Coverage   94.39%   94.68%   +0.29%     
==========================================
  Files          12       12              
  Lines        1052     1035      -17     
==========================================
- Hits          993      980      -13     
+ Misses         59       55       -4     
Files Changed Coverage Δ
...hinxcontrib/autodoc_pydantic/directives/utility.py 96.55% <100.00%> (ø)
sphinxcontrib/autodoc_pydantic/inspection.py 95.34% <100.00%> (+1.38%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 20:47 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 20:47 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 20:47 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 20:47 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 21:23 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 21:23 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 21:23 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 21:23 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 21:26 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen temporarily deployed to ci August 1, 2023 21:26 — with GitHub Actions Inactive
@mansenfranzen mansenfranzen merged commit 001504a into mansenfranzen:main Aug 1, 2023
2 of 12 checks passed
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.

None yet

3 participants