Date_default deprecation warning

I’ve started getting the following deprecation warning. How can I clear this?

/Users/grs53/miniconda3/lib/python3.9/json/ UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
  return _iterencode(o, 0)
1 Like

This might be coming from jupyter-server package; it was fixed a month ago in Fix jupyter_client warning by martinRenou · Pull Request #581 · jupyter-server/jupyter_server · GitHub and released in 1.11.0 a week ago, so you should be able to update:

pip install -U "jupyter_server>=1.11.0"
# or if using conda/mamba:
# conda install "jupyter_server>=1.11.0" -c conda-forge
1 Like

I am running jupyter_server=1.11.1 and still getting the above error.

1 Like

What is your setup? If you are using JupyterHub it could be that you installation defaults to jupyter notebook and not jupyter_server server.

notebook=6.4.4 on Apple arm with python=3.9.7
also tried with newest jupyterlab installed. Error remains the same.

I am getting the same error message and cannot get it to go away. I have updated to the most recent version of jupyter_client (v7.0.6) and jupyter_server (v1.11.1) using conda update for both and the error message persists when I run jupyter notebook

If you take a look at relevant function then you will understand it’s just a warning.
Source: jupyter_client/ at f453b51eeeff9e905c583b7da3905c0e35cfbdf0 · jupyter/jupyter_client · GitHub

def date_default(obj): """DEPRECATED: Use jupyter_client.jsonutil.json_default""" warnings.warn( "date_default is deprecated since jupyter_client 7.0.0." " Use jupyter_client.jsonutil.json_default.", stacklevel=2, ) return json_default(obj)

The json.default function is returned in the last statement. If you want to eliminate this warning you could, per say, maybe remove the content of the function just before the return statement.