In development, you want to avoid having to re-run all upstream models when refactoring part of your project.
What could you do to save time rebuilding models without spending warehouse credits in your next command?
You have written this new agg_completed_tasks dbt model:
with tasks as (
select * from {{ ref('stg_tasks') }}
)
select
user_id,
{% for task in tasks %}
sum(
case
when task_name = '{{ task }}' and state = 'completed'
then 1
else 0
end
) as {{ task }}_completed
{% endfor %}
from tasks
group by 1
The dbt model compiles to:
with tasks as (
select * from analytics.dbt_user.stg_tasks
)
select
user_id,
from tasks
group by 1
The case when statement did not populate in the compiled SQL. Why?
Examine how freshness is defined at the database level:
- name: raw
database: raw
freshness: # default freshness
warn_after: {count: 12, period: hour}
error_after: {count: 24, period: hour}
loaded_at_field: _etl_loaded_at
How can one table from the source raw be excluded from source freshness?
A dbt run failed with an error message.
Order these steps to fix your pipeline.
