Skip to content

Commit 936a5e6

Browse files
kt474ptristan3
andauthored
Deprecate returning JobStatus in RuntimeJob (#1933)
* Deprecate returning JobStatus in RuntimeJob * Add release note --------- Co-authored-by: ptristan3 <44805021+ptristan3@users.noreply.github.com>
1 parent 4e15a91 commit 936a5e6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

qiskit_ibm_runtime/runtime_job.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from concurrent import futures
1717
import logging
1818
import time
19+
import warnings
1920

2021
from qiskit.providers.backend import Backend
2122
from qiskit.providers.jobstatus import JobStatus, JOB_FINAL_STATES
@@ -34,7 +35,7 @@
3435
)
3536
from .utils.result_decoder import ResultDecoder
3637
from .utils.queueinfo import QueueInfo
37-
from .utils.deprecation import deprecate_function
38+
from .utils.deprecation import deprecate_function, issue_deprecation_msg
3839
from .api.clients import RuntimeClient
3940
from .api.exceptions import RequestsApiError
4041
from .api.client_parameters import ClientParameters
@@ -190,6 +191,15 @@ def status(self) -> JobStatus:
190191
Returns:
191192
Status of this job.
192193
"""
194+
warnings.warn(
195+
(
196+
"In a future release of qiskit-ibm-runtime no sooner than 3 months "
197+
"after the release date of 0.30.0, RuntimeJob.status() will be returned as a string "
198+
"instead of an instance of `JobStatus`."
199+
),
200+
DeprecationWarning,
201+
stacklevel=2,
202+
)
193203
self._set_status_and_error_message()
194204
return self._status
195205

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
In a future release, ``RuntimeJob.status()`` will be returned as a string instead of
2+
an instance of ``JobStatus``.

0 commit comments

Comments
 (0)