qiskit-ibm-runtime icon indicating copy to clipboard operation
qiskit-ibm-runtime copied to clipboard

differing calls to job_id and session_id

Open nonhermitian opened this issue 1 year ago • 5 comments

job.job_id is a method where as job.session_id is an attribute. They should both be one or the other.

nonhermitian avatar Jun 02 '23 15:06 nonhermitian

job.job_id is defined in Terra as an attribute. job.session_id is defined in qiskit_ibm_runtime as a property. I think they should both be properties. However, we will not make changes in Terra. @kt474 - do you think I should change job.session_id to be an attribute to be more consistent?

merav-aharoni avatar Jun 05 '23 12:06 merav-aharoni

~~Yeah I think we could change session_id to also be a property~~ Sorry, misunderstood your comment

kt474 avatar Jun 05 '23 18:06 kt474

Yeah I think we could change session_id to also be a property

It is the opposite. session_id is currently a property. Either we turn session_id into an attribute in our code, or else we ask Terra to turn job_id into a property. What do you think?

merav-aharoni avatar Jun 06 '23 07:06 merav-aharoni

I think a good case can be made to have a JobV2 that has job_id as an attribute, given similar things are attributes in BackendV2. We can still maintain backward compatibility by making job_id a "callable string" (i.e. both job.job_id and job.job_id() return the same thing).

jyu00 avatar Jun 06 '23 12:06 jyu00

Opened issue in Terra: https://github.com/Qiskit/qiskit-terra/issues/10213

merav-aharoni avatar Jun 06 '23 13:06 merav-aharoni

Closing because Qiskit doesn't want to change job_id to be an attribute, and it doesn't seem to be worth the effort to make everyone migration from session_id to session_id()

jyu00 avatar May 22 '24 17:05 jyu00