Migrated pydantic v1 API to v2 API for compliance and warning reduction#63
Conversation
…min_max_study_date_xor to an instance method sjoerdk#62
|
@silvandeleemput thanks for the work! It's fine to make those methods instance methods. If all the tests still run we should be fine. |
|
This is a major change to dicomtrolley though. It will break older (maybe too old) applications. @silvandeleemput could you do a major version bump as described here? https://dicomtrolley.readthedocs.io/en/stable/contributing/#incrementing-the-version-number |
sjoerdk
left a comment
There was a problem hiding this comment.
Looks good!
To fix the CI errors look at #64
And please bump the major version as in https://dicomtrolley.readthedocs.io/en/stable/contributing/#incrementing-the-version-number
I can't do this myself as I'm on my phone and making Christmas dinner
|
@sjoerdk Thank you for your timely reply! |
|
Thanks! For some reason github keeps this at status 'blocked, changes requested'. But you already addressed the requested changes. And all tests pass. So I'm bypassing |
Closes #62 Closes #64
This PR migrates the codebase to use the Pydantic v2 API instead of the deprecated v1 API.
This PR almost removes all of the Pydantic-related deprecation warnings, while still passing all the tests.
The steps that I took for the code changes:
bump_pydanticbump_pydantictool, which solved some issues, but did not solve all the issuesbump_pandanticThe only remaining warning is related to the following code.
dicomtrolley/dicomtrolley/mint.py
Lines 162 to 178 in bedfc40
The warning is:
I think this can be easily solved by changing the method to an instance method instead of a class method. Which seems a better fit to me based on my understanding of Pydantic. I've added the change, but please let me know if it should remain a class method for some reason, @sjoerdk.