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.


Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!