-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix result.to_dict() following new 2.0 typing #14124
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the following people are relevant to this code:
|
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.
Thanks for the fix! This must have been an oversight from the qobj removal. To make sure it doesn't slip into the cracks again, could you please add a unit test for the fix? We'd also need a release note.
Co-authored-by: Luciano Bello <[email protected]>
Pull Request Test Coverage Report for Build 14167128266Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
… any ExperimentHeader class to call on, so the type can only be dict.
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.
Thanks a lot again @valente for catching this oversight. I pushed a few changes directly to the branch because of time pressure, as the release is planned for today and this fix unblocks the migration of internal packages to 2.0. I realized that we actually didn't need the release note, as the original PR is technically not released. I also added explicit typing for the remaining input arguments of Result to try to avoid future ambiguities. I am approving but we cannot merge the PR until the CLA is signed. Would you mind clicking on the CLA comment above to get it signed asap?
* fix result.to_dict() following new 2.0 typing * Update qiskit/result/result.py Co-authored-by: Luciano Bello <[email protected]> * add result to_dict test * add release note * Update type hints to reflect current use of Result. We no longer have any ExperimentHeader class to call on, so the type can only be dict. * Remove reno, as the bug is technically unreleased --------- Co-authored-by: valente <[email protected]> Co-authored-by: Luciano Bello <[email protected]> Co-authored-by: Elena Peña Tapia <[email protected]> (cherry picked from commit 00c4756)
* fix result.to_dict() following new 2.0 typing * Update qiskit/result/result.py Co-authored-by: Luciano Bello <[email protected]> * add result to_dict test * add release note * Update type hints to reflect current use of Result. We no longer have any ExperimentHeader class to call on, so the type can only be dict. * Remove reno, as the bug is technically unreleased --------- Co-authored-by: valente <[email protected]> Co-authored-by: Luciano Bello <[email protected]> Co-authored-by: Elena Peña Tapia <[email protected]> (cherry picked from commit 00c4756) Co-authored-by: Abel Valente <[email protected]>
Following on the changes in #13793, I think we should also stop trying to serialize into a dictionary since the header should already be a dictionary.
Currently we face the following issue when doing
result.to_dict()
Added corresponding regression test based on existing to_repr test