英文:
Exclude multiple models from run
问题
To exclude both nz_daily_cohorts
and growth_scorecard
when running dbt run ga4_update_set+
, you can use the following command:
dbt run ga4_update_set+ --exclude nz_daily_cohorts --exclude growth_scorecard
这将排除这两个模型。
英文:
When running dbt with descendants, I would like to exclude two models. I can exclude one model like so:
dbt run ga4_update_set+ --exclude nz_daily_cohorts
The above works as expected.
I tried the following to exclude multiple models.
dbt run ga4_update_set+ --exclude nz_daily_cohorts,growth_scorecard
In this case neither nz_daily_cohorts nor growth_scorecard were excluded.
Then tried:
dbt run ga4_update_set+ --exclude nz_daily_cohorts --exclude growth_scorecard
Again, in this case neither nz_daily_cohorts nor growth_scorecard were excluded.
How can I run dbt run ga4_update_set+
but also exclude both nz_daily_cohorts
and growth_scorecard
?
答案1
得分: 1
最简单的解决方法是用空格分隔排除列表,而不是用逗号分隔
dbt run ga4_update_set+ --exclude nz_daily_cohorts growth_scorecard
如果您需要重复这个任务,创建一个选择器可能更方便:
selectors:
- name: custom_job
definition:
union:
- method: fqn
value: ga4_update_set
children: true
- exclude:
- method: fqn
value: nz_daily_cohorts
- method: fqn
value: growth_scorecard
然后使用以下命令运行您的任务:dbt run --selector custom_job
英文:
The easiest solution is to just space-delimit your exclude list instead of comma-delimiting
dbt run ga4_update_set+ --exclude nz_daily_cohorts growth_scorecard
If you need to repeat this job, it may be more convenient to create a selector:
selectors:
- name: custom_job
definition:
union:
- method: fqn
value: ga4_update_set
children: true
- exclude:
- method: fqn
value: nz_daily_cohorts
- method: fqn
value: growth_scorecard
Then run your command with dbt run --selector custom_job
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论