DBT测试失败尽管store_failures =true

问题描述 投票:0回答:0

尽管DBT检测故障,但雪花中的故障表(

test_unit4_missing_time

)没有存储任何数据。

即使DBT正在编写正确的模式,并且测试配置为sote_failures = true。
在本质上,故障表是瞬态表,但我用永久表(创建或替换表)代替了它,以防止潜在的数据丢失。
,在将表永久化后,失败表现在将更新其最后一个时间戳,但在每个DBT运行后仍保持空。 我试图:

检查了DBT是否试图存储故障 跑:

dbt test -s test_unit4_missing_time --store-failures --debug

指望看到插入到dbt_dev.test_unit4_missing_time语句中,但DBT没有尝试插入任何内容。

检查了DBT是否覆盖而不是附加失败 更新的dbt_project.yml为:

tests: +store_failures: true +on_schema_change: append_new_columns

指出这是为了保留旧失败并存储新的失败,但没有更改。

检查雪花许可是否阻止插入物 跑:

SHOW GRANTS ON TABLE dbt_dev.test_unit4_missing_time;

确认DBT用户具有插入,更新,删除权限。
检查了DBT是否在其他模式中存储故障 跑:

SELECT table_schema, table_name, last_altered FROM information_schema.tables WHERE table_name LIKE 'dbt_test__%';

故障表在预期的架构(dbt_dev)中。
脱落的雪花查询缓存
跑:

ALTER SESSION SET USE_CACHED_RESULT = FALSE; SELECT * FROM dbt_dev.test_unit4_missing_time;

,因为在失败表中没有排。

抛开故障表,让DBT重新创建它
跑:

DROP TABLE dbt_dev.test_unit4_missing_time; dbt test -s test_unit4_missing_time --store-failures

指望DBT创建和填充故障表,但DBT并未创建一个新表,即使测试仍然报告了1250个失败的行。

如果有人在DBT测试中遇到了类似的问题,那么在雪花中没有持续失败,我很感谢您的任何见解!
应该有一些内部DBT行为阻止故障表更新?

我现在已经更改了

dbt_project.yml

中的设置:
tests:
  +store_failures: false

tests: +store_failures: true

进行此更改后,
测试失败表现在被推到雪花上,其中包括我的单数测试和通用测试中的所有失败。
我仍然不完全理解为什么在项目级别上设置

store_failures: false

即使在项目级别上也无法明确配置测试(

store_failures=True

)存储故障。

snowflake-cloud-data-platform etl data-warehouse dbt
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.