Skip to content

Raise error in from_id if the session has no backend #2226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

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

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