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 RuntimeJob #2170

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 @@ -35,6 +35,7 @@
)
from .utils.result_decoder import ResultDecoder
from .utils.queueinfo import QueueInfo
from .utils.deprecation import issue_deprecation_msg
from .api.clients import RuntimeClient
from .api.exceptions import RequestsApiError
from .api.client_parameters import ClientParameters
Expand Down Expand Up @@ -95,7 +96,7 @@ def __init__(
tags: Optional[List] = None,
version: Optional[int] = None,
) -> None:
"""RuntimeJob constructor.
"""(DEPRECATED) RuntimeJob constructor.

Args:
backend: The backend instance used to run this job.
Expand All @@ -112,6 +113,15 @@ def __init__(
tags: Tags assigned to the job.
version: Primitive version.
"""

issue_deprecation_msg(
msg="The RuntimeJob class is deprecated",
version="0.37.0",
stacklevel=4,
remedy="All primitives now return the RuntimeJobV2 class. The major difference between "
"the two classes is that `Job.status()` is returned as a string in RuntimeJobV2.",
)

Job.__init__(self, backend=backend, job_id=job_id)
BaseRuntimeJob.__init__(
self,
Expand Down
3 changes: 3 additions & 0 deletions release-notes/unreleased/2170.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:class:`RuntimeJob` is now deprecated. All of the primitives return :class:`RuntimeJobV2` so there is no need for
``RuntimeJob`` anymore. The major difference between the two classes is that
:meth:`~.RuntimeJobV2.status` returns a string instead of Qiskit's ``JobStatus`` enum.