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-42302: drop support for Pydantic v1 #929

Merged
merged 5 commits into from
Jan 4, 2024
Merged

DM-42302: drop support for Pydantic v1 #929

merged 5 commits into from
Jan 4, 2024

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Dec 21, 2023

Checklist

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

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (12e068c) 88.08% compared to head (44d9491) 88.31%.

Files Patch % Lines
python/lsst/daf/butler/_dataset_ref.py 63.63% 2 Missing and 2 partials ⚠️
python/lsst/daf/butler/registry/wildcards.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #929      +/-   ##
==========================================
+ Coverage   88.08%   88.31%   +0.23%     
==========================================
  Files         307      306       -1     
  Lines       39365    39226     -139     
  Branches     8295     8256      -39     
==========================================
- Hits        34673    34641      -32     
+ Misses       3484     3393      -91     
+ Partials     1208     1192      -16     

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

@TallJimbo TallJimbo marked this pull request as ready for review January 3, 2024 16:49
them or want to support them without the deprecation message.
"""

def json(
Copy link
Member

Choose a reason for hiding this comment

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

I wasn't really sure if we were going to break people by dropping the json method here. I think that there might be people who use SerializedDatasetRef outside of our middleware but maybe only to_simple and from_simple rather than calling .json and .parse_obj. Maybe @mfisherlevine ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've been thinking of all the Serialized* as middleware-internal, but I guess that's not quite true since those *_simple methods are public.

I'd really rather not go through a deprecation period for an interface we just inherit from a third-party package, but I'm happy to stall merging this for a few days to see if Merlin chimes in.

Copy link
Member

Choose a reason for hiding this comment

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

The compromise is to merge this tomorrow after the next weekly and then you have a week to find out from people if we need to put a shim back in specifically for SerializedDatasetRef.

@@ -46,16 +46,10 @@
if TYPE_CHECKING:
from ..registry import Registry

# Pydantic 2 requires we be explicit about the types that are used in
Copy link
Member

Choose a reason for hiding this comment

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

Would this comment still be helpful?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe; the interesting bit is why UUID doesn't work with Any, and I'm guessing it's because there's nothing to distinguish it from str, and it doesn't see if a str is UUID-like unless you explicitly tell it that UUID is a possibility. But that's pure speculation.

Copy link
Member

Choose a reason for hiding this comment

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

I think this was something that became necessary after some pydantic 2 releases had already been made.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll restore the comment, or something like it.

This was by no means a comprehensive attempt to find cases like this,
just a few I happened to spot.
That's what's in rubin-env 8.0.0 (for me), so if it required pydantic
v1 that'd be strange.
This should have happened on DM-41113, but it's only checked when
running GitHub Actions on downstream middleware packages, and there
weren't any branches downstream on that ticket.
@TallJimbo TallJimbo merged commit 7e04138 into main Jan 4, 2024
18 checks passed
@TallJimbo TallJimbo deleted the tickets/DM-42302 branch January 4, 2024 15:10
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