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: 

Confusion around the dollar param being flagged as deprecated

RPalmer
New Contributor III

Over the past week we have seen a warning showing in our notebooks about the dollar param being deprecated. Which has apparently been deprecated since runtime 7, but I cannot find any info about when it will actually be removed. Will the removal be tied to a runtime release?. We are on 13.3 and are in the process of moving to 15.4.

I have also been trying to investigate further and I have found some information the says that as long as the value that we want to use where we currently have $param syntax is set using a text widget  or by a python variable then this is still fine and is not impacted by what is being deprecated. I have attached this as two screenshots in this post.that show some of what I found.

Assuming that we are ok to carry on as well perhaps the code linter is just flagging this as it does not check to see how the value is set that is being $param.

For our notebooks where use $param in table create statements or in select queries for example they all have the value set via text widget so I think we are ok. But I am making this post to try and seek clarification on this in case we need to take action.

Below is an example from one of my notebooks, all bold parameter names have the value set using a text widget:

Any help on clarifying the situation would be much appreciated.

-- Example of a select query

Cell 1:

%python
dbutils.widgets.text("target_catalog_name", "dev", "Enter Catalog Name")

Cell 2:
select * from dtp_${target_catalog_name}.cleansed.testme_source_latest
where date = '2024-08-01' and date <'2024-08-11'
order by site,date,source

-- Example of one of the Create statements 

Cell 1:

%python
dbutils.widgets.text('environment_name', 'dev')
dbutils.widgets.text('optional_sandbox_path', '')
dbutils.widgets.text('catalog_name', ''

environment_name = dbutils.widgets.get('environment_name')
optional_sandbox_path = dbutils.widgets.get('optional_sandbox_path')
catalog_name = dbutils.widgets.get('catalog_name')

Cell 2:
CREATE EXTERNAL TABLE IF NOT EXISTS dtp_${catalog_name}.cleansed.plausible_visit_channel_historical
using DELTA
LOCATION 'abfss://lake@testadls${environment_name}001.dfs.core.windows.net${optional_sandbox_path}/Cleansed/DataProvider=TestMe/DataFeed=visit_time/Version=1/'

6 REPLIES 6

TLee
New Contributor II

Following.

I've been getting the same errors and would like to know the answer to this too.

RPalmer
New Contributor III

I would really appreciate it if someone that knows more about the above could take a look so that I know where I stand as it could mean needing to change quite a number of our notebooks.

PKolarovec
New Contributor II

Same here, would somebody please explain when it will be actually depricated?

Yourstruly
New Contributor II

Does anybody care any more?

This feature is broken and nobody has responded. What is the point of this community? 

BTW this is broken in SQL as well.

Let's say I am using a test widget with value set to '1','2' and param name my_param

In a SQL cell, doing SELECT :my_param, ${my_param} has this result:

'1','2'                 '1'         '2'
'1','2'                  1          2 

Basically completely different behaviour. How can you deprecate something without providing the same functionality? 

Hi,

In this case, :my_param behaves as expected since it keeps '1','2' together as a single string (the same as set in the widget), while ${my_param} interprets it as separate values. Although ${param} still works for now, it’s considered deprecated. There isn’t an official end-of-life date announced, but it’s a good idea to start using the newer :param style going forward.

BS_THE_ANALYST
Esteemed Contributor

Hey everyone, I've just had a look into this. I think the documentation seems pretty clear on what's expected with using the legacy-style parameters https://docs.databricks.com/aws/en/notebooks/legacy-widgets 

BS_THE_ANALYST_0-1755855676990.png


@Yourstruly, I appreciate the frustration but that's an out-of-pocket response. Lots of people give up their free time to help build up the community. That's how it works. You've provided only a single post on your profile; it's really hypocritcal to behave in that manner. Be better than that. If things aren't being resolved by the community, go through the appropriate support routes with databricks themselves:

BS_THE_ANALYST_1-1755855945557.png

 

All the best,
BS

 

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