adnan_alvee
Databricks Employee
Databricks Employee

Hi @ADB0513 

With %run, you dont need to pass anything. %run runs the child inline in the same Python namespace, so the catalog variable set in the main notebook is already visible in the child. Just use it.

# main
catalog = "dev_catalog"
# %run ./child_notebook

# child — catalog is already in scope; no widget, no config
spark.sql(f"INSERT INTO `{catalog}`.target_schema.target_table "
          f"SELECT * FROM `{catalog}`.source_schema.source_table")


Regarding your other concerns:
- Do NOT use spark.conf for this because on serverless a custom key errors outright. 
- Use a widget + dbutils.notebook.run() only if the child must be reusable / isolated (a real orchestration step), not for a plain %run helper.