fix: data testing

This commit is contained in:
Stijnvandenbroek
2026-03-05 17:17:19 +00:00
parent c6f5adf621
commit 7902a5e354
6 changed files with 13 additions and 8 deletions

View File

@@ -57,12 +57,12 @@ def elementary_run_models(context: OpExecutionContext) -> None:
raise Exception(f"dbt run elementary failed with exit code {result.returncode}")
_EDR_REPORT_PATH = _DBT_DIR / "edr_target" / "elementary_report.html"
@op(ins={"after": In(Nothing)})
def elementary_generate_report(context: OpExecutionContext) -> None:
"""Run edr report to regenerate the Elementary HTML report."""
report_path = (
Path(__file__).parents[2] / "dbt" / "edr_target" / "elementary_report.html"
)
cmd = [
"edr",
"report",
@@ -71,7 +71,7 @@ def elementary_generate_report(context: OpExecutionContext) -> None:
"--project-dir",
str(_DBT_DIR),
"--file-path",
str(_EDR_REPORT_PATH),
str(report_path),
]
context.log.info(f"Running: {' '.join(cmd)}")
result = subprocess.run(cmd, capture_output=True, text=True)

View File

@@ -0,0 +1,5 @@
-- Compatibility shim: dbt 1.11 changed macro resolution so unnamespaced intra-package
-- calls from elementary no longer resolve. Forwarding macro makes it findable globally.
{% macro get_upload_artifact_method(table_relation, metadata_hashes) %}
{% do return(elementary.get_upload_artifact_method(table_relation, metadata_hashes)) %}
{% endmacro %}

View File

@@ -120,7 +120,7 @@ sources:
tests:
- not_null
- accepted_values:
values: ["funda", "woz", "cadastre"]
values: ["Funda", "WOZ"]
- name: status
description: Price event type (asking_price, sold, or woz).
tests:

View File

@@ -89,7 +89,7 @@ models:
data_type: text
tests:
- accepted_values:
values: ["A+++", "A++", "A+", "A", "B", "C", "D", "E", "F", "G"]
values: ["A3", "A2", "A1", "A", "B", "C", "D", "E", "F", "G"]
where: "energy_label is not null"
- name: living_area
description: Interior floor area in m².

View File

@@ -48,7 +48,7 @@ models:
tests:
- not_null
- accepted_values:
values: ["funda", "woz", "cadastre"]
values: ["Funda", "WOZ"]
- name: price_status
description: Type of price event.
data_type: text

View File

@@ -2,4 +2,4 @@ packages:
- package: dbt-labs/dbt_utils
version: [">=1.0.0", "<2.0.0"]
- package: elementary-data/elementary
version: [">=0.16.0", "<0.17.0"]
version: [">=0.22.0", "<0.23.0"]