diff --git a/qiskit_ibm_runtime/runtime_job.py b/qiskit_ibm_runtime/runtime_job.py index 296315265..cdbb27864 100644 --- a/qiskit_ibm_runtime/runtime_job.py +++ b/qiskit_ibm_runtime/runtime_job.py @@ -16,6 +16,7 @@ from concurrent import futures import logging import time +import warnings from qiskit.providers.backend import Backend from qiskit.providers.jobstatus import JobStatus, JOB_FINAL_STATES @@ -34,7 +35,7 @@ ) from .utils.result_decoder import ResultDecoder from .utils.queueinfo import QueueInfo -from .utils.deprecation import deprecate_function +from .utils.deprecation import deprecate_function, issue_deprecation_msg from .api.clients import RuntimeClient from .api.exceptions import RequestsApiError from .api.client_parameters import ClientParameters @@ -190,6 +191,15 @@ def status(self) -> JobStatus: Returns: Status of this job. """ + warnings.warn( + ( + "In a future release of qiskit-ibm-runtime no sooner than 3 months " + "after the release date of 0.30.0, RuntimeJob.status() will be returned as a string " + "instead of an instance of `JobStatus`." + ), + DeprecationWarning, + stacklevel=2, + ) self._set_status_and_error_message() return self._status diff --git a/release-notes/unreleased/1933.deprecation.rst b/release-notes/unreleased/1933.deprecation.rst new file mode 100644 index 000000000..0cb674d03 --- /dev/null +++ b/release-notes/unreleased/1933.deprecation.rst @@ -0,0 +1,2 @@ +In a future release, ``RuntimeJob.status()`` will be returned as a string instead of +an instance of ``JobStatus``. \ No newline at end of file