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

Fixing Pydantic Extension #1021

Merged
merged 2 commits into from
Jul 9, 2023
Merged

Fixing Pydantic Extension #1021

merged 2 commits into from
Jul 9, 2023

Conversation

sydney-runkle
Copy link
Contributor

Hey tfranzel,

Thanks for your help with adding support for pydantic a few weeks ago.

It came to my attention earlier today while running some tests that the __schema_cache__ from pydantic was causing problems when any of the pages associated with the schema views were refreshed. The model_schema function from pydantic doesn't use a cache, whereas the model.schema() does utilize this cache. Additionally, the ref_prefix param of the model_schema function allows for the removal of some of the other functionality we hard coded.

I came up with the above solution based on the pydantic documentation as well as this previously opened issue.

Let me know what you think!

Copy link
Owner

@tfranzel tfranzel left a comment

Choose a reason for hiding this comment

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

excellent point @sydney-runkle. it is the better implementation.

I totally forgot about #801 and reimplemented the extension. 🤣 I wonder though how he got the extension working without the 3 fixes we applied specifically for this to work.

docs/blueprints/pydantic.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 9, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (e0f749e) 98.54% compared to head (f31c7a6) 98.54%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1021   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files          68       68           
  Lines        8338     8338           
=======================================
  Hits         8217     8217           
  Misses        121      121           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tfranzel tfranzel merged commit b800dfb into tfranzel:master Jul 9, 2023
29 checks passed
@tfranzel
Copy link
Owner

tfranzel commented Jul 9, 2023

excellent! thx sydney.

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

2 participants