Deprecation warning from Jupyter: "`should_run_async` will not call `transform_cell` automatically in the future"

Viewed 32275

When I import a package I get the following deprecation message. I can't find any documentation about it. I know I can suppress the warnings but I would like to know what's happening.

import pandas as pd

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipykernel/ipkernel.py:287: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.
  and should_run_async(code)

Installation: Python 3.8.5, jupyter-client 6.1.6, jupyter-core 4.6.3, jupyterlab 2.2.4, jupyterlab-server 1.2.0 on Mac OS

3 Answers

Upgrading ipykernel 5.3.4 seems to have fixed it for me.

pip install --upgrade ipykernel

Make sure to restart your Juptyer server afterwards.

I came up with this by inserting a breakpoint() at /ipkernel.py:287 and using w to see what was making the call. If this fix doesn't work for you, worth checking what's making the call in your case.

Same here with ipykernel==5.3.4 and ipython==7.19.0. Downgrading to ipython 7.10.0 fixed the problem.

pip install install ipython==7.10.0

Optionally for suppressing DeprecationWarnings:

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)

Same here with python==3.9.2, ipykernel==5.5.0 and ipython==7.21.0 in a conda environment defaulting to conda-forge repositories. Upgrading ipykernel to the latest 5.5.3 doesn't solve anything.

It is currently linked to this ipykernel issue.

Related