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

DM-40366: Use default pydantic model for testing #878

Merged
merged 1 commit into from
Aug 12, 2023
Merged

Conversation

timj
Copy link
Member

@timj timj commented Aug 11, 2023

Previously we changed the pydantic models used in testing to be the compatibility models that understand v1 and v2. This is fine but means that any external users using pydantic models as butler datasets break if they are still using v1.

Change the test model to use whatever is the native pydantic and then the YAML formatter has been modified to support both APIs. The JSON formatter already supported both.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Previously we changed the pydantic models used in testing to be
the compatibility models that understand v1 and v2. This is fine
but means that any external users using pydantic models as
butler datasets break if they are still using v1.

Change the test model to use whatever is the native pydantic
and then the YAML formatter has been modified to support
both APIs. The JSON formatter already supported both.
@timj timj requested a review from tgoldina August 11, 2023 22:23
@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: -0.02% ⚠️

Comparison is base (42f2c38) 87.72% compared to head (7c5e2c1) 87.71%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #878      +/-   ##
==========================================
- Coverage   87.72%   87.71%   -0.02%     
==========================================
  Files         274      274              
  Lines       36096    36107      +11     
  Branches     7549     7552       +3     
==========================================
+ Hits        31665    31670       +5     
- Misses       3259     3264       +5     
- Partials     1172     1173       +1     
Files Changed Coverage Δ
python/lsst/daf/butler/formatters/yaml.py 74.46% <63.63%> (-5.54%) ⬇️
...ython/lsst/daf/butler/tests/_examplePythonTypes.py 88.99% <71.42%> (-1.49%) ⬇️

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

Copy link
Contributor

@tgoldina tgoldina left a comment

Choose a reason for hiding this comment

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

Thank you! The YamlFormatter failure with pydantic<2.0 is fixed.

@timj timj merged commit 41038f7 into main Aug 12, 2023
14 of 16 checks passed
@timj timj deleted the tickets/DM-40366 branch August 12, 2023 04:46
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.

2 participants