In our largest ML modeling pipeline notebook we need to delete a single input (code) cell (containing sensitive information which we cannot pass via other means when automating its execution).
The cell has been created (injected) by papermill.execute_notebook()
executed in another notebook (controller) and has been auto-tagged with injected-parameters
tag.
The solution (possibly not the only one?) is deleting the cell as soon as it gets executed.
If searching for a tag makes it extra difficult, than let's use solutions for just deleting the previous input cell (programmatically).
What did not work
Hiding the input cell is not good enough, as it would still get saved to the disk (this includes the report_only
option in papermill's execute_notebook()
). Also "converting" with nbconvert
to HTML (which does allow to select cells for removal on the basis of their tags, as in this solution) would still preserve the original notebook with the encoded password inside.