databricks notebook parameter works in interactive mode but not in the job

Dimitry
Valued Contributor

Hi guys

 

I've added a parameter "files_mask " to a notebook, with a default value.

The job running this notebook broke with error: com.databricks.dbutils_v1.InputWidgetNotDefined: No input widget named files_mask is defined

Code: mask = dbutils.widgets.get('files_mask')

The problem is, it works in interactive mode but not in the job. How do I use parameters defined in the notebook as-is, without redefining them in job? I'm happy for them to run on defaults as declared in the notebook.

 

szymon_dybczak
Esteemed Contributor III

Hi @Dimitry ,

Do you use python or scala in your notebook?

Because there was similar thread where user states that it doesn't work in Scala

InputWidgetNotDefined exception when running a not... - Databricks Community - 45600

I'm using Python and run it under a standard compute (not serverless).

I don't have Scala cells in the notebook and it is confusing, as the other thread was about failing in Scala but working in Python.

Dimitry_0-1761692401086.png

 

Also, the same problem with SQL cells

Dimitry_0-1761705933290.png