batchspawner icon indicating copy to clipboard operation
batchspawner copied to clipboard

JupyterHub 4 deprecation warning

Open cmd-ntrf opened this issue 1 year ago • 1 comments
trafficstars

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 ([email protected]) >
[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.

cmd-ntrf avatar Apr 04 '24 18:04 cmd-ntrf

Similarly jupyterhub/wrapspawner#55, some overlapping users for both packages

rcthomas avatar Apr 04 '24 18:04 rcthomas