-
Notifications
You must be signed in to change notification settings - Fork 70
Allow runtime program authors to retrieve program data #174
Allow runtime program authors to retrieve program data #174
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not working as expected when I call runtime.programs()
first and then call runtime.program("some_id").data
, because runtime.programs()
doesn't have data
info and if we get a single program after that, it will return from cached programs list and the data
will be empty. So you need to fetch the program data if someone tries to access the data
property and if data is empty, and if it still errors then show not authorized message.
15a9d5d
to
ab33b52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fetch data
from server when someone calls program.data
property, if it doesn't already exist.
Is there a way to specifically fetch |
No there is no API to fetch just data. You would have to refresh the entire program object when someone does |
But then shouldn't we just always refresh? Even if we could just refresh the whole object only when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kt474 Could you write unit tests and also rebase this branch?
Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com>
Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com>
Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com>
…t-ibm into runtime-program-data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kt474 I don't see any unit tests. I see just integration tests.
f8a0abb
to
aea236b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kt474 Almost there.. left just one minor suggestion..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks @kt474 !
* Remove version field from runtime program (#152) * Remove version field from runtime program * Add release note * Rename isPublic to is_public when creating or reading runtime programs (#155) * Update programId to program_id when running program (#139) This needs to change in the program upload body request in order to meet the IBM Cloud API guidance. Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Add support to view program update date (#160) * Upload runtime program using 'data' field (#157) * Read programs from "programs" array in response (#161) * Remove version field from runtime program (#152) * Remove version field from runtime program * Add release note * Rename isPublic to is_public when creating or reading runtime programs (#155) * Update programId to program_id when running program (#139) This needs to change in the program upload body request in order to meet the IBM Cloud API guidance. Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Add support to view program update date (#160) * Upload runtime program using 'data' field (#157) * Read programs from "programs" array in response (#161) * Pass program as base64 string to update (#168) * Accept JSON schema as program metadata (#158) * Accept JSON schema as program metadata * Update qiskit_ibm/runtime/ibm_runtime_service.py Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Pass program params as object (#171) * Fix integration tests * Use count to reduce one last extra call to API (#172) * Allow updating runtime metadata in place (#188) * update runtime metadata * return if no data * fix mypy * Update releasenotes/notes/update-runtime-metadata-d2ddbcfc0d034530.yaml Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * Remove version field from runtime program (#152) * Remove version field from runtime program * Add release note * Rename isPublic to is_public when creating or reading runtime programs (#155) * Update programId to program_id when running program (#139) This needs to change in the program upload body request in order to meet the IBM Cloud API guidance. Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Add support to view program update date (#160) * Upload runtime program using 'data' field (#157) * Read programs from "programs" array in response (#161) * Pass program as base64 string to update (#168) * Accept JSON schema as program metadata (#158) * Accept JSON schema as program metadata * Update qiskit_ibm/runtime/ibm_runtime_service.py Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Pass program params as object (#171) * Fix integration tests * Use count to reduce one last extra call to API (#172) * Allow updating runtime metadata in place (#188) * update runtime metadata * return if no data * fix mypy * Update releasenotes/notes/update-runtime-metadata-d2ddbcfc0d034530.yaml Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * Allow filtering runtime jobs by program ID (#193) * Allow filtering runtime jobs by program ID * Fix lint * Allow runtime program authors to retrieve program data (#174) * retrieve program data * refetch once if no program data * remove unused import * refresh program on data property * fix lint * Update qiskit_ibm/runtime/runtime_program.py Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * Update qiskit_ibm/runtime/runtime_program.py Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * Update qiskit_ibm/runtime/runtime_program.py Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * add test case * add test case * add default data constant * add _validate_program method * Update test/ibm/runtime/test_runtime.py Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * Update cache after updating program (#196) * Allow filtering runtime jobs by provider (#197) * add provider param * split provider into hub/group/project * add reno * wip add test case * fix lint/docs * Update qiskit_ibm/runtime/ibm_runtime_service.py Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * Update releasenotes/notes/filter-jobs-by-provider-dead04faaf223840.yaml Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * refactor test cases * remove print * add integration test Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * Support pagination for retrieving runtime programs (#170) * wip add limit/offset params * add reno * refactor & update test case * offset -> skip, implement refresh logic * refresh when skip/limit not default * Update releasenotes/notes/runtime-program-pagination-8d599ae984a5ce33.yaml Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * Update releasenotes/notes/runtime-program-pagination-8d599ae984a5ce33.yaml Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * add to test case * refactor refresh logic * refactor * fix lint * add integration test * update doc string * Update qiskit_ibm/api/clients/runtime.py Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> * cleanup merge * Apply suggestions from code review * fix lint refactor * Fetch all programs upfront 20 at a time and store in cache For subsequent requests paginate and return from cache * Fix integration test Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> Co-authored-by: Rathish Cholarajan <Rathish.C@ibm.com> Co-authored-by: Renier Morales <renier@users.noreply.github.com> Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> Co-authored-by: Kevin Tian <kevin.tian@ibm.com>
Summary
fixes #66
switching base branch to
runtime-release-q4
replaces #166Details and comments