Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Added close_session #762

Merged
merged 6 commits into from
Oct 30, 2023
Merged

Added close_session #762

merged 6 commits into from
Oct 30, 2023

Conversation

merav-aharoni
Copy link
Collaborator

@merav-aharoni merav-aharoni commented Oct 29, 2023

Summary

Added IBM_Backend.close_session in addition IBM_Backend.cancel_session.

Details and comments

Requested in the review of Qiskit/qiskit-ibm-runtime#1138.

@coveralls
Copy link

coveralls commented Oct 29, 2023

Pull Request Test Coverage Report for Build 6689794076

  • 5 of 19 (26.32%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.07%) to 51.215%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_provider/api/clients/runtime.py 1 2 50.0%
qiskit_ibm_provider/ibm_backend.py 1 6 16.67%
qiskit_ibm_provider/api/rest/runtime_session.py 3 11 27.27%
Totals Coverage Status
Change from base Build 6642642765: -0.07%
Covered Lines: 3372
Relevant Lines: 6584

💛 - Coveralls

@merav-aharoni merav-aharoni marked this pull request as ready for review October 29, 2023 15:41
@merav-aharoni merav-aharoni requested a review from kt474 October 29, 2023 15:42
if self._session:
self._session.cancel()
if self._session.session_id:
self.provider._runtime_client.cancel_session(self._session.session_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.provider._runtime_client.cancel_session doesn't exist in this repo so it'll have to be added there as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I shouldn't have submitted for review so quickly. I copied the implementation from runtime. Also added a test, though it is pretty trivial. We will unite this functionality back when uniting the two repos.

@kt474 kt474 merged commit 1c04e79 into Qiskit:main Oct 30, 2023
18 checks passed
@merav-aharoni merav-aharoni deleted the close_session branch October 31, 2023 06:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants