You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The get_url_parameter generally works for long parameters, but if it's a small param that could be included in other parameters, it will not work properly. While UTMs are the most common types of URL parameters, I've worked with companies that those &c, &e, and other tiny parameters in them that doesn't work with this macro.
Steps to reproduce
Use get_url_parameter on a URL where the characters of one parameter is also inside another parameter, such as:
select {{ dbt_utils.get_url_parameter(field='page_url', url_parameter='ce') }}
where page_url ='https://www.dbt.com?utm_source=github'
Expected results
In the above example, I would expect the macro to not return a parameter, because it doesn't have &ce or ?ce in it.
Actual results
The macro would return github as the 'ce' parameter.
Screenshots and log output
System information
The contents of your packages.yml file:
Which database are you using dbt with?
postgres
redshift
bigquery
snowflake
other (specify: ____________)
The output of dbt --version:
<output goes here>
Additional context
Are you interested in contributing the fix?
The text was updated successfully, but these errors were encountered:
The solution I ended up using was to coalesce a split part of ?param= and a split part of ¶m= together. That way it works for either of those situations, but it's not triggered by the param being at the end of another param.
I can submit a PR for that if everyone likes that solution? It's ugly, but it works for all the use cases I deal with.
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.
Describe the bug
The get_url_parameter generally works for long parameters, but if it's a small param that could be included in other parameters, it will not work properly. While UTMs are the most common types of URL parameters, I've worked with companies that those
&c
,&e
, and other tiny parameters in them that doesn't work with this macro.Steps to reproduce
Use
get_url_parameter
on a URL where the characters of one parameter is also inside another parameter, such as:Expected results
In the above example, I would expect the macro to not return a parameter, because it doesn't have
&ce
or?ce
in it.Actual results
The macro would return github as the 'ce' parameter.
Screenshots and log output
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:Additional context
Are you interested in contributing the fix?
The text was updated successfully, but these errors were encountered: