Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbt v1 compat #453

Merged
merged 15 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Backport android url changes from #426 (#452)
  • Loading branch information
joellabes authored Dec 2, 2021
commit fd8dc17ba9df576fcaef9c16bb0899e528018ba3
5 changes: 4 additions & 1 deletion integration_tests/data/web/data_url_host.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
original_url,parsed_url
www.google.co.uk?utm_source=google&utm_medium=cpc&utm_campaign=spring-summer,www.google.co.uk
http://witanddelight.com/2018/01/tips-tricks-how-run-half-marathon-first-time/,witanddelight.com
https://www.nytimes.com/2018/01/01/blog,www.nytimes.com
https://www.nytimes.com/2018/01/01/blog,www.nytimes.com
android-app://m.facebook.com/,m.facebook.com
docs.nytimes.com/2021/01/01/index.js?utm_source=google,docs.nytimes.com
https://m.facebook.com/,m.facebook.com
11 changes: 6 additions & 5 deletions macros/web/get_url_host.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@

{% macro default__get_url_host(field) -%}

{%- set parsed =
{%- set parsed =
dbt_utils.split_part(
dbt_utils.split_part(
dbt_utils.replace(
dbt_utils.replace(field, "'http://'", "''"
dbt_utils.replace(
dbt_utils.replace(field, "'android-app://'", "''"
), "'http://'", "''"
), "'https://'", "''"
), "'/'", 1
), "'?'", 1
)

-%}


{{ dbt_utils.safe_cast(
parsed,
dbt_utils.type_string()
)}}


{%- endmacro %}