Closed mriedem closed 7 months ago
In hindsight, we definitely should've waited for session.details()
before releasing the from_id()
method. While passing in the backend
parameter works, having the option to pass in any backend is confusing. We can get the backend from session.details
, but that requires the service
parameter which we unfortunately have has optional.
Not sure the best way to handle this from a deprecation perspective, but in #1311, from_id()
is updated to work as long as backend
or service
are passed in and an error is thrown if neither are passed. So in short, we want backend
to be deprecated but service
to be a required argument.
Describe the bug
The
backend
kwarg toSession.from_id
is deprecated:https://github.com/Qiskit/qiskit-ibm-runtime/blob/stable/0.17/qiskit_ibm_runtime/session.py#L312
But if you don't specify a backend you get a ValueError:
Steps to reproduce
This is a simple little test I wrote which I expect to raise an error but not the ValueError about a backend not being specified:
Expected behavior
The API should reject the request since the session doesn't exist with the given id.
Suggested solutions
n/a - it's confusing because the backend kwarg is deprecated so I was trying to stop using it, but when you stop using it with the ibm_quantum channel you get an error because it's actually required...
Additional Information