Date_default deprecation warning

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

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

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

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

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/jsonutil.py 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.

“”"
C:\Users\rb_se\anaconda3\Lib\site-packages\jupyter_client\jasonutil.py

was modified 6-Sept-2023 as such,
to prevent the following error message from popping up when
Jupyter Notebook starts up:

97
97 def date_default(obj):
98 “”“DEPRECATED: Use jupyter_client.jsonutil.json_default
99 warnings.warn(
100 “date_default is deprecated since jupyter_client 7.0.0.”
101 " Use jupyter_client.jsonutil.json_default.”,
102 stacklevel=2,
103 )
104 “”"
105 return json_default(obj)

It’s simply returning an empty object as the result of commenting out the entire contents of the function.
I find it to be a good habit to always document any changes made to modules.