cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
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.


Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.