Skip to content

Commit 519bb53

Browse files
authored
Move Provider import only under TYPE_CHECKING conditions (#1489)
### 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
1 parent 940b94d commit 519bb53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

qiskit_experiments/framework/experiment_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from qiskit.result import Result
3737
from qiskit.providers.jobstatus import JobStatus, JOB_FINAL_STATES
3838
from qiskit.exceptions import QiskitError
39-
from qiskit.providers import Job, Backend, Provider
39+
from qiskit.providers import Job, Backend
4040
from qiskit.utils.deprecation import deprecate_arg
4141
from qiskit.primitives import BitArray, SamplerPubResult, BasePrimitiveJob
4242

@@ -76,6 +76,7 @@
7676
# `TYPE_CHECKING` means that the import will never be resolved by an actual
7777
# interpreter, only static analysis.
7878
from . import BaseExperiment
79+
from qiskit.providers import Provider
7980

8081
LOG = logging.getLogger(__name__)
8182

0 commit comments

Comments
 (0)