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

Avoid exception in Target.has_calibration for instruction without properties #12526

Merged

Conversation

wshanks
Copy link
Contributor

@wshanks wshanks commented Jun 6, 2024

Summary

Avoid exception in Target.has_calibration for instruction without properties

Details and comments

Target.add_instruction allows passing None in place of an InstructionProperties instance. In this case, there will be no _calibration attribute, so the getattr call properties needs to provide a default value, as done in this change.

Closes #12525

…roperties

`Target.add_instruction` allows passing `None` in place of an
`InstructionProperties` instance. In this case, there will be no
`_calibration` attribute, so the `getattr` call properties needs to
provide a default value.
@wshanks wshanks requested a review from a team as a code owner June 6, 2024 22:16
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@wshanks wshanks added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Jun 6, 2024
@coveralls
Copy link

coveralls commented Jun 6, 2024

Pull Request Test Coverage Report for Build 9408550043

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 89.594%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 91.6%
Totals Coverage Status
Change from base Build 9407377778: 0.04%
Covered Lines: 62375
Relevant Lines: 69620

💛 - Coveralls

@mtreinish mtreinish added this to the 1.1.1 milestone Jun 6, 2024
@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Jun 6, 2024
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

LGTm, thanks for catching and fixing this.

@mtreinish mtreinish enabled auto-merge June 6, 2024 22:48
@mtreinish mtreinish added this pull request to the merge queue Jun 6, 2024
Merged via the queue into Qiskit:main with commit 72f09ad Jun 7, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Jun 7, 2024
…roperties (#12526)

`Target.add_instruction` allows passing `None` in place of an
`InstructionProperties` instance. In this case, there will be no
`_calibration` attribute, so the `getattr` call properties needs to
provide a default value.

(cherry picked from commit 72f09ad)
github-merge-queue bot pushed a commit that referenced this pull request Jun 7, 2024
…roperties (#12526) (#12527)

`Target.add_instruction` allows passing `None` in place of an
`InstructionProperties` instance. In this case, there will be no
`_calibration` attribute, so the `getattr` call properties needs to
provide a default value.

(cherry picked from commit 72f09ad)

Co-authored-by: Will Shanks <willshanks@us.ibm.com>
Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this pull request Aug 1, 2024
…roperties (Qiskit#12526)

`Target.add_instruction` allows passing `None` in place of an
`InstructionProperties` instance. In this case, there will be no
`_calibration` attribute, so the `getattr` call properties needs to
provide a default value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Target.has_calibration errors for instructions without properties
4 participants