jupyterhub / jupyterhub/batchspawner

JupyterHub 4 deprecation warning

Open
#306 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
207
Forks
136
PR merge metrics
No merged PRs in 30d

Description

After spawning a job with batchspawner 1.3.0 and JupyterHub 4.1.4, the following deprecation warning is logged:
```
[I 2024-04-04 15:55:26.989 JupyterHub log:192] 200 POST /hub/api/batchspawner (user001@172.16.4.43) >
[W 2024-04-04 15:55:27.093 JupyterHub spawner:172]
The shared database session at Spawner.db is deprecated, and will be removed.
Please manage your own database and connections.

Contact JupyterHub at https://github.com/jupyterhub/jupyterhub/issues/3700
if you have questions or ideas about direct database needs for your Spawner.
```

This warning is triggered when a Spawner access the property `db`. In the case of BatchSpawner, it happens only here:
https://github.com/jupyterhub/batchspawner/blob/fe5a893eaf9eb5e121cbe36bad2e69af798e6140/batchspawner/batchspawner.py#L461

And base on git blame, this line was added 9 years ago as it was recommended by JupyterHub doc at the time.
https://github.com/jupyterhub/batchspawner/commit/88b6a4f375686cf70e6d1befe6358a15bd435df3

Based on this JupyterHub commit https://github.com/jupyterhub/jupyterhub/commit/ac3ef1efc120c1ccf339042a872d2ea86285d529 , `db` has been depecrated since JupyterHub 3. So we either remove it entirely if it serves no purpose for any of the supported JupyterHub versions, or we check if JupyterHub version is smaller than 3 before executing the db commit line.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.