将查询标签添加到DBT测试
我想询问您在DBT测试中添加雪花查询的查询标签。
是否有任何方法可以将查询标签添加到项目或模式YAML文件中?我已经尝试过,但我找不到方法。
我可以修改一些软件包,例如 dbt_utils.unique_combination_of_columns.combination_of_columns
添加查询标签语句。但是,如果我在下面的YAML中使用模式测试,在哪里以及如何定义测试的查询标签?
models:
name: dim_customers
columns:
- name: company
tests:
- not_null
- unique
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
, in line 3 calls a macro named set_query_tag(), that it's defined
这将覆盖默认的宏,并使用测试名称标记所有运行(类似于not_null__model_name__name__column_name)。如果您只想在测试中进行操作,则需要添加一些额外的话,如果/其他使用
,请检查这似乎这是几天前的可能性,因此现在可以按预期使用较旧版本来工作...
The default macro in the dbt package for snowflake, in line 3 calls a macro named set_query_tag(), that it's defined here. What you can do is to create a custom set_query_tag() in your dbt project, following this example (taken from here):
This will override the default macro and tag all your runs with the test name (something like not_null__model_name__column_name). If you only want to do it with tests, you need to add some extra if/else using
Also, check this it seems that this is possible since a few days ago, so it could now work as expected with older versions...