Pankaj Verma
Pankaj Verma

Reputation: 51

dbutils.notebook.run does not pick run notebook saved on DBFS location

I export my databricks workspace directory (/Users/xyz/) contents which has several python notebooks and scripts onto a databricks specific location for e.g. /dbfs/tmp and then try to call the following code to run a python notebook named xyz.py from the exported location as follows:

dbutils.notebook.run("/dbfs/tmp/xyz", timeout_seconds=1200)

OR

dbutils.notebook.run("dbfs:/tmp/xyz", timeout_seconds=1200)

OR

dbutils.notebook.run("../../tmp/xyz", timeout_seconds=1200)

dbutils always does not able to find the notebook path and gives following exception:

com.databricks.WorkflowException: com.databricks.NotebookExecutionException: Unknown state: Notebook not found: /dbfs:/tmp/xyz

Though if I check the same dbfs path for the notebook existence then I can see the notebook has been placed.

How can I run the dbutils.notebook.run statement with a specific location from databricks?

Upvotes: 2

Views: 2794

Answers (1)

CHEEKATLAPRADEEP
CHEEKATLAPRADEEP

Reputation: 12788

This is an excepted behavior with the dbutils.notebook.runs. When you specify the location other than "/Users/[email protected]/notebookname" it throws the following error message com.databricks.WorkflowException: com.databricks.NotebookExecutionException: Unknown state: Notebook not found: /tmp/mount.dbc.

I would suggest you to place all the notebooks under users and then you can call the notebooks using dbuitls.notebook.run("/Users/[email protected]/NotebookName").

enter image description here

Upvotes: 1

Related Questions