我正在尝试定义一个 dbt YAML 选择器,以便我可以为一组特定的模型运行架构测试。
YAML 选择器看起来有点像这样:
selectors:
- name: test_selector
definition:
union:
- intersection:
- node+
- tag:tag1
- intersection:
- node+
- tag:tag2
- intersection:
- node+
- +tag:tag3
- intersection:
- node+
- +tag:tag4
- exclude:
- config.materialized:view
- config.materialized:materialized_view
Run Code Online (Sandbox Code Playgroud)
该选择器描述了单个节点上游和节点联合下游的节点选择,不包括视图和物化视图(在我们的 dbt 项目中自定义)。
使用此语法,我可以使用 成功列出此语法指定的节点dbt ls --selector test_selector --output name,并使用 成功运行指定的模型dbt run --selector test_selector,但相同的行为似乎不适用于dbt test。
当我尝试时dbt test --selector test_selector,我收到输出
WARNING: Nothing to do. Try checking your model configs and …Run Code Online (Sandbox Code Playgroud) dbt ×1