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

Make name a required param in backend() #1636

Merged
merged 1 commit into from
Apr 25, 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
9 changes: 9 additions & 0 deletions qiskit_ibm_runtime/qiskit_runtime_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,15 @@ def backend(
QiskitBackendNotFoundError: if no backend could be found.
"""
# pylint: disable=arguments-differ, line-too-long
if not name:
warnings.warn(
(
"The `name` parameter will be required in a future release no sooner than "
"3 months after the release of qiskit-ibm-runtime 0.24.0 ."
),
DeprecationWarning,
stacklevel=2,
)
backends = self.backends(name, instance=instance)
if not backends:
cloud_msg_url = ""
Expand Down
3 changes: 3 additions & 0 deletions release-notes/unreleased/1147.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
``name`` will now be a required parameter in
`backend() https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.QiskitRuntimeService#backend`__.
``backend()`` will no longer return the first backend out of all backends if ``name`` is not provided.
Loading