cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

InputWidgetNotDefined exception when running a notebook as a job

MarcinO
New Contributor II

I have a notebook that reads a value of a text input in a Scala command:

var startTimeStr = dbutils.widgets.get("Run Date")
What doesn't make any sense that this notebook fails with InputWidgetNotDefined error when being scheduled as a job, but works just fine in interactive mode, on the same cluster. Any advice?
2 REPLIES 2

MarcinO
New Contributor II

I have a number of notebooks that have Widgets and I run them both interactively and in job mode without exceptions. The difference that is these notebooks are in Python, and the one I reported InputWidgetNotDefined exception for is in Scala. So I think there is an inconsistency between Scala and Python runtime here.

The reason I like using Widgets for notebooks that I also run as jobs is that you can set parameters manually during testing or, as you said via job parameters, and you use the same dbutils.widgets.get() API to get the input. It works great in Python commands! But for some reason doesn't work in Scala, that's unfortunate.

berserkersap
Contributor

Have you used dbutils.widget.text() before dbutils.widget.get() ?

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now