-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature/alias #800
Feature/alias #800
Changes from all commits
2b1378c
3726cd1
4fb70c1
76ced75
81e644a
ecb7c86
69e6c9a
75b91a8
b11ebb0
9fd89d7
a2b5f73
64f420d
5040c88
ca7992b
874d1b9
06d459a
144f453
20b84c4
ff84f2a
6c6f18a
f39b5a6
d8a2e57
73a474e
f872ed0
e5739b3
f2ef85a
d274196
307a4e1
ed9f884
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
|
||
{% macro string_literal(s) -%} | ||
{{ adapter_macro('test.string_literal', s) }} | ||
{%- endmacro %} | ||
|
||
{% macro default__string_literal(s) %} | ||
'{{ s }}'::text | ||
{% endmacro %} | ||
|
||
{% macro bigquery__string_literal(s) %} | ||
cast('{{ s }}' as string) | ||
{% endmacro %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. random: let's move this macro https://github.com/fishtown-analytics/dbt-utils/blob/master/macros/cross_db_utils/safe_cast.sql from dbt-utils to dbt proper. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, agree, that would be super useful. Do you think that should happen in this PR or a different one? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
-- cross-db compatible test, similar to accepted_values | ||
|
||
{% macro test_expect_value(model, field, value) %} | ||
|
||
select count(*) | ||
from {{ model }} | ||
where {{ field }} != '{{ value }}' | ||
|
||
{% endmacro %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks really useful