paiqo / Databricks-VSCode

VSCode extension to work with Databricks
GNU General Public License v3.0
123 stars 27 forks source link

Widget Anomaly #164

Open potter-potter opened 1 year ago

potter-potter commented 1 year ago

Thanks for the widget support. It is super helpful.

I noticed something strange when you pass in a string variable instead of a string into dbutils.widgets.get(). It will return the default and not the set value.

dbutils.widgets.text("table_name","default.table","Table Name")

If I set the table name to bobs.table

bt=dbutils.widgets.get("table_name")
bt

Out[60]: 'bobs.table'

but:

rr="table_name"
bt2=dbutils.widgets.get(rr)
bt2

Out[60]: 'default.table'

Any suggestions? We use a function to return widget parameters by passing in the parameter name. And this is not working.

Thank you.

danw22 commented 1 year ago

I am having the same issue as well

gbrueckl commented 1 year ago

this is super tricky as we are handling widgets on the client side (within VSCode) only hence it is hard to refer to variables in widget names

i could think of some possible solutions but this will take some time to implement so dont expect any solution for this before Q4 2023

I will update you here

gbrueckl commented 1 month ago

after another review we decided that this feature is too complex to implement and we will not implement it.

but I would still like to understand more, why you want to use a dynamic reference for a static widget?