Skip to content
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

Remove Spawner.db dependency to address access deprecation #317

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

Conversation

tgmachina
Copy link

@tgmachina tgmachina commented Dec 1, 2024

This is meant to fix #306

I first noticed the issue in my PR #313 both developing locally (I downgraded JupyterHub to get tests to pass). I decided to try and fix this to help my other PR along.

My changes at a high-level:

  • Modify new_spawner to instantiate a sufficiently patched spawner directly, bypassing the orm user instantiation
  • Convert new_spawner to a contextmanager to drop patches after test completion
  • Created a mock user that has the minimum api to allow the spawner to work
  • Dropped the use of event_loop (I'm guessing this was perhaps necessary when using the orm instantiated spawner?)
  • Finally, removed self.db.commit() from BatchSpawnerBase.start: I didn't see why it would be necessary to have and having written other spawners myself, I don't recall ever needing it (open to clarification on this point)

To the last point about just removing self.db.commit() rather than checking for a minimum version, I also remembered reading this in the upstream jupyterhub issue:

...one impediment to that is assumptions of a persistent db session on various objects. Authenticators and Spawners have this, but shouldn't.

I assumed @minrk's comment was true for all versions.

@tgmachina tgmachina changed the title Remove Spawner.db dependency to address deprecation warnings Remove Spawner.db dependency to address deprecation Dec 1, 2024
@tgmachina tgmachina changed the title Remove Spawner.db dependency to address deprecation Remove Spawner.db dependency to address access deprecation Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JupyterHub 4 deprecation warning
1 participant