From 519bb534c134ca9a251f4f92f6abd39f56017341 Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Fri, 15 Nov 2024 17:57:40 +0100 Subject: [PATCH] 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 https://github.com/qiskit-community/qiskit-experiments/issues/1488 --- qiskit_experiments/framework/experiment_data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/framework/experiment_data.py b/qiskit_experiments/framework/experiment_data.py index db71273ffd..a4cd953967 100644 --- a/qiskit_experiments/framework/experiment_data.py +++ b/qiskit_experiments/framework/experiment_data.py @@ -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 @@ -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__)