Skip to content

Commit

Permalink
Move Provider import only under TYPE_CHECKING conditions (#1489)
Browse files Browse the repository at this point in the history
### Summary

Qiskit 1.1 deprecated the Provider abstract class to be removed in 2.0
(planned for 1Q2025). In those cases where the class is used for only
typechecking purposes, the import should only happen when
`TYPE_CHECKING`. For the rest of the cases, I opened
#1488
  • Loading branch information
1ucian0 authored Nov 15, 2024
1 parent 940b94d commit 519bb53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qiskit_experiments/framework/experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from qiskit.result import Result
from qiskit.providers.jobstatus import JobStatus, JOB_FINAL_STATES
from qiskit.exceptions import QiskitError
from qiskit.providers import Job, Backend, Provider
from qiskit.providers import Job, Backend
from qiskit.utils.deprecation import deprecate_arg
from qiskit.primitives import BitArray, SamplerPubResult, BasePrimitiveJob

Expand Down Expand Up @@ -76,6 +76,7 @@
# `TYPE_CHECKING` means that the import will never be resolved by an actual
# interpreter, only static analysis.
from . import BaseExperiment
from qiskit.providers import Provider

LOG = logging.getLogger(__name__)

Expand Down

0 comments on commit 519bb53

Please sign in to comment.