Home > Software engineering >  Can you update a notebook's dataframe from another notebook in databricks?
Can you update a notebook's dataframe from another notebook in databricks?

Time:06-23

I have many notebooks that currently have a dataframe with a path like this: %run "/Shared/folder/script/notebook"

I want to update this path on all these notebooks to this path instead and I'd like to do this from another notebook: %run "/Repos/Dev/folder/script/notebook"

Is there a simple way of doing this?

CodePudding user response:

From what I understand there are many notebooks where you want to change %run "/Shared/folder/script/notebook" to %run "/Repos/Dev/folder/script/notebook"

So if I had to do the above I would export all the notebooks from a root folder in source file format

Then use notepad to open them all and replace all of them at once or can use a batch script from here

Change the root folder name in databricks to _backup and create a new root folder and upload updated files in it then delete backup if updated files look fine

  • Related