nteract / papermill

📚 Parameterize, execute, and analyze notebooks
http://papermill.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
5.99k stars 428 forks source link

PapermillNotebookClient deprecation warning: unrecognized argument input_path #783

Closed woutdenolf closed 8 months ago

woutdenolf commented 8 months ago

Reproduce:

import os
import warnings

os.environ["JUPYTER_PLATFORM_DIRS"] = "1"  # remove jupyter_client deprecation warning
warnings.simplefilter("error")  # raise the PapermillNotebookClient deprecation warning

from papermill import execute_notebook

execute_notebook("no_parameters.ipynb", "result.ipynb", xxx=100)

Trace:

Traceback (most recent call last):
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/traitlets/traitlets.py", line 1379, in __init__
    super().__init__(*super_args, **super_kwargs)
TypeError: object.__init__() takes exactly one argument (the instance to initialize)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/denolf/projects/ewokscore/test.py", line 9, in <module>
    execute_notebook("no_parameters.ipynb", "result.ipynb", xxx=100)
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/papermill/execute.py", line 119, in execute_notebook
    nb = papermill_engines.execute_notebook_with_engine(
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/papermill/engines.py", line 48, in execute_notebook_with_engine
    return self.get_engine(engine_name).execute_notebook(nb, kernel_name, **kwargs)
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/papermill/engines.py", line 365, in execute_notebook
    cls.execute_managed_notebook(nb_man, kernel_name, log_output=log_output, **kwargs)
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/papermill/engines.py", line 434, in execute_managed_notebook
    return PapermillNotebookClient(nb_man, **final_kwargs).execute()
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/papermill/clientwrap.py", line 30, in __init__
    super().__init__(nb_man.nb, km=km, raise_on_iopub_timeout=raise_on_iopub_timeout, **kw)
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/nbclient/client.py", line 456, in __init__
    super().__init__(**kw)
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/traitlets/config/configurable.py", line 92, in __init__
    super().__init__(**kwargs)
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/traitlets/traitlets.py", line 1385, in __init__
    warn(
  File "/home/denolf/virtualenvs/pybox_yg1f6S/lib/python3.9/site-packages/traitlets/utils/warnings.py", line 14, in warn
    warnings.warn(msg, category=category, stacklevel=stacklevel, source=source)
DeprecationWarning: Passing unrecognized arguments to super(PapermillNotebookClient).__init__(input_path='no_parameters.ipynb', xxx=100).
object.__init__() takes exactly one argument (the instance to initialize)
This is deprecated in traitlets 4.2.This error will be raised in a future release of traitlets.

I did this in python 3.9 with

jupyter_client            8.6.0
jupyter_core              5.7.1
nbclient                  0.9.0
papermill                 2.5.0
platformdirs              4.2.0
traitlets                 5.14.1
woutdenolf commented 8 months ago

Sorry, it was already fixed by https://github.com/nteract/papermill/pull/740