Databricks: 清除所有笔记本中所有单元格的内容

huangapple go评论61阅读模式
英文:

Databricks: Clear Contents of All Cells in All Notebooks

问题

有一需求确保已从系统中删除给定类型的所有数据,包括可能存在于Databricks笔记本中的任何单元输出。是否有一种方式可以清除从给定根目录开始的所有笔记本中的所有单元格输出(例如,对于整个实例或给定目录及其子目录中的所有笔记本)?

英文:

We have a need to ensure that all data of a given type have been removed from our system. This includes any cell output that might exist in a Databricks Notebook.

Is there a way to clear the cell outputs from all cells in all Notebooks starting from a given root (e.g. for an entire instance or for all notebooks in a given directory and sub-directories).

答案1

得分: 1

最接近的替代方法我能想到的是将每个笔记本导出为源代码,然后将其导入到相同的位置。但这将更改笔记本的ID,这将破坏那些已经创建了书签的人的链接。另外,您将需要使用列表API来列出笔记本和目录,并遍历列表来编写脚本。

英文:

The closest alternative that I can think about is to export each notebook as SOURCE and then import it back into the same location. But this will change the notebook ID that will break bookmarks if people have them. Plus you'll need to script this yourself using list API to list notebooks & directories and walk through the list

huangapple
  • 本文由 发表于 2023年4月4日 03:09:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75922979.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定