英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论