DBT是否可以将配置添加到单个模型中的所有测试中

发布于 2025-02-08 00:17:46 字数 620 浏览 0 评论 0原文

我希望一个模型中的所有测试仅测试最新数据。我可以在整个项目或这样的文件夹中应用一个条款:

tests:
  my_project:
    marts:
      finance:
        +where: "date_column = current_date"

但是,如果我确实更深入地将其置于模型上:

tests:
  my_project:
    marts:
      finance:
        fct_revenue_events:
          +where: "date_column = current_date"

我会收到警告,并且似乎不起作用:

[WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- tests.my_project.marts.finance.fct_revenue_events

我该如何应用我的仅在一个模型中的所有测试中的子句?

I want all tests within one model to only test recent data. I can apply a where clause to the whole project or to a folder like so:

tests:
  my_project:
    marts:
      finance:
        +where: "date_column = current_date"

But if I do go one level deeper and put it on a model:

tests:
  my_project:
    marts:
      finance:
        fct_revenue_events:
          +where: "date_column = current_date"

I get an warning and it doesn't seem to work:

[WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- tests.my_project.marts.finance.fct_revenue_events

How can I apply my where clause to all tests within one model only?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文