Azure Databricks: specify programmatically notebook path that contains special character '$' in dbutils.notebook.run

Viewed 207

I have a databricks notebook with the following line:

dbutils.notebook.run(f"{notebooks_base_path}/test_notebook", 60, {})

The value string for "notebooks_base_path" parameter is an existing root path in the workspace with this value: "/base/oracle/dim/ops$test"

When execute it, recieve an exception related to parsing the notebook path:

com.databricks.WorkflowException: com.databricks.NotebookExecutionException: FAILED: Notebook not found: /base/oracle/dim/ops$test/test_notebook

I suppose there is an issue parsing "$" in the path, any suggestion?

Thanks

2 Answers

we can handle it in different approach as python variables as like this ,

var_1 = 'Users'
var_2 = 'id@heb.com'
var_3 = 'pull'
var_2 = 'r183532@heb.com'
var = '/'+ var_1 + '/' + var_2 +'/'+ var_3
print(var)
dbutils.notebook.run(var,10)

enter image description here

It looks like it's not possible to do right now because of the some internal implementation details. Escaping of the $ character with \ and $ doesn't help.

I recommend to open a support ticket to solve it.

P.S. Also, you may look onto multitask jobs instead, and or arbitrary files in Repos (if your code is in Python)

Related