Skip to content

Conversation

kt474
Copy link
Member

@kt474 kt474 commented Apr 16, 2025

Summary

Details and comments

Fixes #1959

@kt474 kt474 marked this pull request as ready for review April 19, 2025 17:19
@kt474 kt474 added the Changelog: Bugfix Include in the Fixed section of the changelog label Apr 19, 2025
@kt474 kt474 requested review from jyu00 and ElePT April 19, 2025 17:20
Copy link
Collaborator

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

Based off the PR removing the Optional type hint from Session, it seems clear that sessions should always have backends right? However if a user creates a session and doesn't send any jobs the backend doesn't get set. The error seems fine but I don't think this behavior is very intuitive. I wonder if there is a way to set the backend in the session from the moment it's created without requiring jobs?

@kt474
Copy link
Member Author

kt474 commented Apr 22, 2025

Based off the PR removing the Optional type hint from Session, it seems clear that sessions should always have backends right? However if a user creates a session and doesn't send any jobs the backend doesn't get set. The error seems fine but I don't think this behavior is very intuitive. I wonder if there is a way to set the backend in the session from the moment it's created without requiring jobs?

Yeah I agree it's not intuitive - it's been a long ongoing discussion see ntc 5063 for more context

@kt474 kt474 merged commit 3f3e435 into Qiskit:main Apr 29, 2025
17 checks passed
@ElePT ElePT added this to the 0.39.0 milestone May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the Fixed section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Session.from_id unexpectedly changes the backend
2 participants