If you use ** Japanese for the folder name or Notebook name **, use dbutils.notebook.run to use another There is a case that an error occurs when calling Notebook
I have a notebook with the following folder structure
/Users/xxx@yyy.jp
|-MyNotebook
|-My notebook
|-MyNotebookCaller
|-MyNotebook Caller
|-test
|-MyNotebook
|-MyNotebookCaller
Of these, if the following cases apply, calling another Notebook using dbutils.notebook.run failed.
-** Caller ** If you use Japanese
in the name of your Notebook
-/Users/[email protected]/MyNotebook Caller
-** Caller ** When Japanese is used
for the name of the storage folder of Notebook
-/Users/[email protected]/test
/MyNotebookCaller
In the following cases, the call was successful without any problem.
--When Japanese is used
for the name of the called notebook
-/Users/[email protected]/My Notebook
--When Japanese is used
for the name of the storage folder of the called Notebook
-/Users/[email protected]/test
/MyNotebook
It is a simple process of calling by passing parameters from MyNotebookCaller
or MyNotebook Caller
to MyNotebook
, and printing
the received parameters in MyNotebook
.
/Users/xxx@yyy.jp/MyNotebook
dbutils.widgets.text("param1", "111")
dbutils.widgets.text("param2", "222")
print("param1:{},param2:{}".format(dbutils.widgets.get("param1"), dbutils.widgets.get("param2")))
#/Users/xxx@yyy.jp/Same as My Notebook
/Users/xxx@yyy.jp/MyNotebookCaller
#Cmd1 Call MyNotebook in the same folder
dbutils.notebook.run(
"./MyNotebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
#Cmd2 Call My Notebook in the same folder
dbutils.notebook.run(
"./My notebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
#Call My Notebook in the Cmd3 test folder
dbutils.notebook.run(
"./test/MyNotebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
#/Users/xxx@yyy.jp/Same as MyNotebookCaller
#/Users/xxx@yyy.jp/Same as My Notebook
#Cmd1 Call MyNotebook in the same folder
dbutils.notebook.run(
"./MyNotebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
#Cmd2 Call MyNotebook in the folder one level above
dbutils.notebook.run(
"../MyNotebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
Japanese is used
for the name of the calling NotebookTry calling MyNotebook in the same folder from /Users/[email protected]/MyNotebook Caller
Cmd1 Call MyNotebook in the same folder
dbutils.notebook.run(
"./MyNotebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
As a result, I got a WorkflowException
.
It seems that an error was returned by using Japanese, which is a character other than Latin characters (ASCII character set).
com.databricks.WorkflowException: com.databricks.common.client.DatabricksServiceHttpClientException: INVALID_PARAMETER_VALUE: Only Latin1 (ASCII) characters are currently supported. Any international characters must be removed or replaced in workflow_context
Even if I call MyNotebook in the test folder,
Cmd2 Call MyNotebook in the test folder
dbutils.notebook.run(
"./test/MyNotebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
This also caused a WorkflowException
com.databricks.WorkflowException: com.databricks.common.client.DatabricksServiceHttpClientException: INVALID_PARAMETER_VALUE: Only Latin1 (ASCII) characters are currently supported. Any international characters must be removed or replaced in workflow_context
Japanese is used
for the name of the storage folder of the calling NotebookTry calling MyNotebook in the same folder from /Users/[email protected]/test
/MyNotebookCaller
Cmd1 Call MyNotebook in the same folder
dbutils.notebook.run(
"./MyNotebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
This also resulted in a WorkflowException
com.databricks.WorkflowException: com.databricks.common.client.DatabricksServiceHttpClientException: INVALID_PARAMETER_VALUE: Only Latin1 (ASCII) characters are currently supported. Any international characters must be removed or replaced in workflow_context
Japanese is used
for the name of the called notebookTry calling /Users/[email protected]/MyNotebook
from /Users/[email protected]/MyNotebookCaller
Cmd2 Call My Notebook in the same folder
dbutils.notebook.run(
"./My notebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
The process ended normally even though Japanese was used for the called notebook name. It seems that the passed parameters are also output properly.
param1:val1,param2:val2
Japanese is used
for the name of the storage folder of the called notebookTry calling /Users/[email protected]/test
/MyNotebook from /Users/[email protected]/MyNotebookCaller
Call My Notebook in the Cmd3 test folder
dbutils.notebook.run(
"./test/MyNotebook",
60,
{
"param1": "val1",
"param2": "val2"
}
)
The process ended normally even though Japanese was used for the folder name of the called notebook. It seems that the passed parameters are also output properly.
param1:val1,param2:val2
Be careful when using Japanese for folder names and notebook names
Recommended Posts