LewisDavies / upstream-prod

A dbt package for easily using production data in a development environment.
32 stars 4 forks source link

--empty run option doesn't work when upstream_prod_enable is TRUE #39

Open amwidi77 opened 3 months ago

amwidi77 commented 3 months ago

When running a dbt model with the --empty flag and upstream_prod_enabled: False, dbt generates the sql from the ref() to include where false limit 0 which is what we would expect. However, when running with upstream_prod_enabled: True, the additional where condition is not included.

Ideally, the where condition is still included so we can take advantage of both the upstream_prod and --empty optimizations.

See https://docs.getdbt.com/reference/commands/run#the---empty-flag