cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Seeking Assistance with Dynamic %run Command Path

Lotfi
New Contributor II

Hello Databricks Community Team,

I trust this message finds you well. I am currently facing an issue while attempting to utilize a dynamic path with the %run command to execute a notebook called from another folder. I have tested the following approaches using a conf_file variable:

  1. %run "/Users/.../blob_conf/{}".format(conf_file)
  2. %run f"/Users/.../blob_conf/{conf_file}"

Unfortunately, neither approach seems to be working as expected.

I would greatly appreciate your guidance and assistance in resolving this matter.

Thank you for your time and support.

Best regards,

Lotfi

2 REPLIES 2

chari
Contributor

Hi,

 If your config file is in the databricks file system then you should add dbfs:/

Ex: f"dbfs:/Users/.../blob_conf/{conf_file}"

Lotfi
New Contributor II

Hello Chari,

I appreciate your response, but I'd like to clarify that I prefer not to utilize the filestore of DBK for storing my configuration file. Instead, I aim to directly execute the notebook that houses my Python configuration.
Furthermore, employing 'dbutils.notebook.run()' function doesn't enable me to access and utilize the declared variables within the notebook.
Thank youuu for any help.


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