The Wayback Machine - https://web.archive.org/web/20201129172030/https://github.com/PrefectHQ/prefect/issues/3687
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow exporter arguments in Jupyter ExecuteNotebook task #3687

Open
swierh opened this issue Nov 19, 2020 · 1 comment · May be fixed by #3725
Open

Allow exporter arguments in Jupyter ExecuteNotebook task #3687

swierh opened this issue Nov 19, 2020 · 1 comment · May be fixed by #3725

Comments

@swierh
Copy link

@swierh swierh commented Nov 19, 2020

Current behavior

When running the jupyter.jupyter.ExecuteNotebook task with output_format='html' the default settings for the HTMLExporter are used. There is no way to pass arguments to this exporter.

Proposed behavior

Allow passing arguments to the HTMLExporter.

Implementation suggestion

Something like html_exporter = nbconvert.HTMLExporter(**exporter_kwargs) on the following line:
https://github.com/PrefectHQ/prefect/blob/master/src/prefect/tasks/jupyter/jupyter.py#L65

Example usecase

This allows you to exclude code cells, only showing their output, in the exported html document by passing the exclude_input=True argument to the exporter.

@madkinsz
Copy link
Contributor

@madkinsz madkinsz commented Nov 23, 2020

Since this would only apply to the html exporter and not the json output perhaps it'd make sense to allow make output_format a Union[str, Exporter] so an initialized exporter can be passed in directly instead with whatever arguments you want (base Exporter type at https://github.com/jupyter/nbconvert/blob/master/nbconvert/exporters/exporter.py#L49)

@swierh swierh linked a pull request that will close this issue Nov 27, 2020
3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.