Skip to content

Instantly share code, notes, and snippets.

@Victoriapm
Created June 8, 2023 15:41
Show Gist options
  • Select an option

  • Save Victoriapm/78a566623c9d15e38eb367eb0be89773 to your computer and use it in GitHub Desktop.

Select an option

Save Victoriapm/78a566623c9d15e38eb367eb0be89773 to your computer and use it in GitHub Desktop.
Apply dev limits to dbt models
-- Alternative one: Limit the result regardless of the query
select *
from event_tracking.events
{% if target.name == 'dev' %}
limit 10
{% endif %}
-- Alternative 2: Limit the result depending on the loading date
select *
from event_tracking.events
{% if target.name == 'dev' %}
where created_at >= dateadd('day', -3, current_date)
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment