Remove Spawner.db dependency to address access deprecation #317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
new_spawnerto instantiate a sufficiently patchedspawnerdirectly, bypassing theormuser instantiationnew_spawnerto acontextmanagerto drop patches after test completionuserthat has the minimum api to allow thespawnerto workevent_loop(I'm guessing this was perhaps necessary when using theorminstantiatedspawner?)self.db.commit()fromBatchSpawnerBase.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:I assumed @minrk's comment was true for all versions.