Questions tagged [dbt-utils]
7 questions
1
vote
1 answer
dbt_utils union_relations column_override not working
{{ dbt_utils.union_relations(
relations=[
ref('base_consumer_digital_ad_performance_apple_ads_spend'),
ref('base_consumer_digital_ad_performance_facebook_spend'),
…

C.Carrel
- 49
- 6
1
vote
2 answers
Using jinja sql variables in dbt_utils
In my dbt project, if I declare a jinja sql variable how can I pass it to a dbt_utils function?
For example this doesn't work:
{% set exclude_columns = ["col1", "col2", "col3"] %}
SELECT {{ dbt_utils.star(from=ref('table'), except=exclude_columns)…

Nema Sobhani
- 41
- 5
1
vote
2 answers
How to use dbt_utils.union_relations in snowflake?
I have the following code:
{{
config(
materialized='table',
unique_key='dbt_scd_id'
)
}}
with unioned as (
{{ dbt_utils.union_relations(
relations=[
ref('blaze_inventory_stg'),
],
include=[
…

BigBoy1337
- 4,735
- 16
- 70
- 138
1
vote
3 answers
Syntax error unexpected 'with' while using dbt_utils.date_spine
I am trying to use the dbt_utils.date_spine macro :
select
{{ dbt_utils.date_spine(datepart="day", start_date="cast('2019-01-01' as date)", end_date="cast('2020-01-01' as date)") }} as purchase_date
from table(generator(rowcount=>10))
And get the…

Monish Tandale
- 11
- 1
- 3
0
votes
1 answer
Dbt datediff - dict object compilation errors
Recently, upgraded my dbt to v1.3 and facing some issues with a few macros but a new compilation error keeps coming for datediff or datespine , which is not working out
Error message:
09:29:41 'dict object' has no attribute 'datediff'. This can…

Pravin
- 461
- 5
- 26
0
votes
1 answer
dbt query to Snowflake resulting in an "invalid identifier" error for a column that exists
I've been pulling my hair out for several hours trying to understand what's going on, to no avail so far.
I've got this query on dbt:
{{
config(
materialized='incremental',
unique_key='event_ID'
)
}}
SELECT
{{…

coisnepe
- 480
- 8
- 18
0
votes
1 answer
Error in DBT cloud Server error: Database Error in rpc request (from remote system) syntax error at or near ")"
WITH unioned_product_reports AS(
{% set prod_relations = dbt_utils.get_relations_by_pattern('xyz_shema', 'test_products%') %}
{{ dbt_utils.union_relations(relations = prod_relations) }}
ranking_product_report_rows AS(
SELECT *,
…

MegaBytes
- 6,355
- 2
- 19
- 36