I want combine my 2 different notebooks and add one condition on received parameter. If parameter is True then run all cell of that notebook and if parameter is false only run added code from another notebooks that will be few bottom cells.
Basically i want to reduce the loading time of two notebook so combining them to one
dbutils.widgets.text("condition", "True", "Condition: (True or False)")
condition_str = dbutils.widgets.get("condition") condition = condition_str.lower() == "true"
def run_cell(cell_id): dbutils.notebook.run(f"/FullNotebookPath", timeout_seconds=0, arguments={"cell_id": cell_id})
If condition:
for cell_number in range(1, 11): run_cell(cell_number)
else:
For cell_number in range(6, 11): run_cell(cell_number)
But the execution is failing.. Its working if i run single cell without for loop.