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() ?

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group