store_failures_as
store_failures_as
test 리소스 타입에서 store_failures_as는 테스트 실패를 데이터베이스에 어떻게 저장할지 지정하는 선택적 config예요. store_failures도 함께 설정되어 있다면 store_failures_as가 우선해요.
출처: 문서
본문
지원되는 값은 세 가지예요.
ephemeral— 데이터베이스에 아무것도 저장하지 않음 (기본값)table— 테스트 실패를 데이터베이스 테이블로 저장view— 테스트 실패를 데이터베이스 뷰로 저장
store_failures와 같은 모든 위치에서 설정할 수 있어요. singular 테스트(.sql 파일), generic 테스트(.yml 파일), dbt_project.yml을 포함해요.
Examples
Singular test
tests/singular/check_something.sql 파일의 singular 테스트:
{{ config(store_failures_as="table") }}
-- custom singular test
select 1 as id
where 1=0
Generic test
models/_models.yml 파일의 generic 테스트:
models:
- name: my_model
columns:
- name: id
data_tests:
- not_null:
config:
store_failures_as: view
- unique:
config:
store_failures_as: ephemeral
Project level
dbt_project.yml의 config:
name: "my_project"
version: "1.0.0"
config-version: 2
profile: "sandcastle"
data_tests:
my_project:
+store_failures_as: table
my_subfolder_1:
+store_failures_as: view
my_subfolder_2:
+store_failures_as: ephemeral
"Clobbering" configs
대부분의 다른 설정처럼 store_failures_as도 계층적으로 적용될 때 "clobber"(덮어씀)돼요. 더 구체적인 값이 있으면 덜 구체적인 값을 완전히 대체해요.
추가 자료:
- Data test configurations
- Data test-specific configurations
- Configuring directories of models in dbt_project.yml
- Config inheritance
더 알아보기 (Learn more)
- store_failures — 실패 저장 여부 설정.
- Data test configurations — 데이터 테스트 설정 개요.
- Config inheritance — 계층적 config 상속.