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-42376: Fix dump_kwargs TypeError. #281

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Conversation

MichelleGower
Copy link
Contributor

@MichelleGower MichelleGower commented Jan 6, 2024

Checklist

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

Copy link

codecov bot commented Jan 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (52bb5ef) 87.27% compared to head (cfd6fbd) 87.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #281      +/-   ##
==========================================
+ Coverage   87.27%   87.41%   +0.13%     
==========================================
  Files          49       49              
  Lines        4417     4433      +16     
  Branches      762      764       +2     
==========================================
+ Hits         3855     3875      +20     
+ Misses        410      406       -4     
  Partials      152      152              

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

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for adding a test.

@@ -0,0 +1 @@
Fix dump_kwargs TypeError.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Fix dump_kwargs TypeError.
Fix ``dump_kwargs`` `TypeError` caused by migration to Pydantic 2.

# to calculate time-stamped runs across a second boundary.
args.output_run = qgraph.metadata["output_run"]

with makeTmpFile(suffix=".json") as tmpname:
Copy link
Member

Choose a reason for hiding this comment

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

I had not noticed that there was a special temp file context manager written for this test file. Next time I'm looking I need to replace that with something more standard. The content parameter is only used in one place so it doesn't seem like we are gaining much.

self.assertEqual(taskFactory.countExec, self.nQuanta)
self.assertTrue(
os.path.exists(tmpname) and os.path.getsize(tmpname) > 0, "Failed to create summary file"
)
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 I'd like the two lines added to read the file back in

with open(tmpname) as fh:
    Report.model_validate_json(fh.read())

I think that would mean we wouldn't need the above assertTrue because it would only work if the file existed and had something in it.

@MichelleGower MichelleGower merged commit 8a8c9d3 into main Jan 8, 2024
15 checks passed
@MichelleGower MichelleGower deleted the tickets/DM-42376 branch January 8, 2024 18:51
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