Skip to content

Commit

Permalink
Deprecate returning JobStatus in RuntimeJob (#1933)
Browse files Browse the repository at this point in the history
* Deprecate returning JobStatus in RuntimeJob

* Add release note

---------

Co-authored-by: ptristan3 <[email protected]>
  • Loading branch information
kt474 and ptristan3 authored Sep 23, 2024
1 parent 4e15a91 commit 936a5e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion qiskit_ibm_runtime/runtime_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions release-notes/unreleased/1933.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
In a future release, ``RuntimeJob.status()`` will be returned as a string instead of
an instance of ``JobStatus``.

0 comments on commit 936a5e6

Please sign in to comment.