Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate returning JobStatus in RuntimeJob #1933

Merged
merged 5 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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``.