cancel
Showing results for 
Search instead for 
Did you mean: 
Community Discussions
cancel
Showing results for 
Search instead for 
Did you mean: 

The risks of code execution by default on widget change

Israel_H
New Contributor III

Taking from my experience, the default action of widgets triggering code execution upon value change poses risks that outweigh the convenience in certain scenarios.

While this feature may seem advantageous in some cases, it can lead to unintended consequences and a less controlled development environment. Having a widget's value change automatically trigger code execution during the midst of development or maintenance can have significant ramifications if the code is not adequately structured or tested. Moreover, it becomes even more problematic if the inattentive user fails to perceive that an execution has occurred.

Given these considerations, I believe the default behavior for widget value change should be to do nothing, or at least make it so that the user can customize this setting in their preferences. Additionally, implementing a visual cue in the IDE to indicate that widget changes will trigger code execution would provide developers with a clearer understanding of the potential impacts of their actions.

3 REPLIES 3

feiyun0112
Contributor III

click gear icon on top right, set Widget panel settings

capture 2024-02-06 032347.png

 

 

Israel_H
New Contributor III

Yes, I'm aware that it can be changed for each notebook. What I don't think is safe is for it to 'Run' by default instead of 'Do nothing'.

Kayla
Contributor

I definitely have to agree with the original point- if you have a notebook that you import, and you touch any widget value you're running code, most likely accidentally. I'd love to see a workspace or user type option where you can change the default to "do nothing" for all widgets/notebooks.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.