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-40303: Fix pydantic v2 warnings #363
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #363 +/- ##
==========================================
+ Coverage 83.97% 84.18% +0.21%
==========================================
Files 77 77
Lines 9086 9070 -16
Branches 1741 1739 -2
==========================================
+ Hits 7630 7636 +6
+ Misses 1166 1145 -21
+ Partials 290 289 -1
☔ View full report in Codecov by Sentry. |
Dict and Pydantic have different APIs when using a method but copy.copy() works with both.
@@ -97,7 +98,7 @@ def run(self, input: TaskMetadata | dict[str, int]) -> Struct: # type: ignore | |||
Struct with a single ``output`` attribute. | |||
""" | |||
self.log.info("Run method given data of type: %s", get_full_type_name(input)) | |||
output = input.copy() | |||
output = copy.copy(input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tested by ctrl_mpexec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, few minor comments.
This is in a metaclass and so mypy does not really know what the class is.
Checklist
doc/changes