cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

%run and Repos path error

indianaDE
New Contributor

We have one notebook(N1) which uses the %run command to call a second notebook(N2) which also calls a third notebook(N3) using %run. When running the %run cell within N2, N3 is successfully called and run. When running the %run cell within N1 we  get the error below. These %run commands are using the relative paths ./ to call the subnotebooks (N2 and N3), so that the code is portable between branches:

Notebook not found: Workspace/Repos/user_folder/<DevOps Repository Name>/folder/NB3....

The %run is replacing the user defined name of the Repo, with the actual name of the DevOps repository. This is not the path to N3 which should have the user defined folder name within the path. All other methods to return the absolute path of the NBs (ls, dbutils, os etc. show the correct path). 

Our environment recently received the update which moved the Repo folder under the Workspace folder, is there any chance there was an issue casued there?

1 REPLY 1

Brahmareddy
Honored Contributor

Hi @indianaDE,

How are you doing today?

As per my understanding, 

 

Consider checking the relative paths you’re using in the %run commands, as the recent update might have changed how Databricks resolves paths for notebooks under the new Workspace/Repos structure. Instead of relying on relative paths (./), try using absolute paths to ensure the correct notebooks are referenced. You could also explore using dbutils.notebook.run() for more flexibility in specifying paths. If the issue persists, review whether the Repo folder structure update could be interfering with path resolution, and verify that each path correctly aligns with the new folder hierarchy.

Give a try and let me know how it goes.

Good day!

Regards,

Brahma

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group