fix: data testing
This commit is contained in:
@@ -57,12 +57,12 @@ def elementary_run_models(context: OpExecutionContext) -> None:
|
|||||||
raise Exception(f"dbt run elementary failed with exit code {result.returncode}")
|
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)})
|
@op(ins={"after": In(Nothing)})
|
||||||
def elementary_generate_report(context: OpExecutionContext) -> None:
|
def elementary_generate_report(context: OpExecutionContext) -> None:
|
||||||
"""Run edr report to regenerate the Elementary HTML report."""
|
"""Run edr report to regenerate the Elementary HTML report."""
|
||||||
|
report_path = (
|
||||||
|
Path(__file__).parents[2] / "dbt" / "edr_target" / "elementary_report.html"
|
||||||
|
)
|
||||||
cmd = [
|
cmd = [
|
||||||
"edr",
|
"edr",
|
||||||
"report",
|
"report",
|
||||||
@@ -71,7 +71,7 @@ def elementary_generate_report(context: OpExecutionContext) -> None:
|
|||||||
"--project-dir",
|
"--project-dir",
|
||||||
str(_DBT_DIR),
|
str(_DBT_DIR),
|
||||||
"--file-path",
|
"--file-path",
|
||||||
str(_EDR_REPORT_PATH),
|
str(report_path),
|
||||||
]
|
]
|
||||||
context.log.info(f"Running: {' '.join(cmd)}")
|
context.log.info(f"Running: {' '.join(cmd)}")
|
||||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||||
|
|||||||
5
dbt/macros/elementary_compat.sql
Normal file
5
dbt/macros/elementary_compat.sql
Normal 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 %}
|
||||||
@@ -120,7 +120,7 @@ sources:
|
|||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
- accepted_values:
|
- accepted_values:
|
||||||
values: ["funda", "woz", "cadastre"]
|
values: ["Funda", "WOZ"]
|
||||||
- name: status
|
- name: status
|
||||||
description: Price event type (asking_price, sold, or woz).
|
description: Price event type (asking_price, sold, or woz).
|
||||||
tests:
|
tests:
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ models:
|
|||||||
data_type: text
|
data_type: text
|
||||||
tests:
|
tests:
|
||||||
- accepted_values:
|
- 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"
|
where: "energy_label is not null"
|
||||||
- name: living_area
|
- name: living_area
|
||||||
description: Interior floor area in m².
|
description: Interior floor area in m².
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ models:
|
|||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
- accepted_values:
|
- accepted_values:
|
||||||
values: ["funda", "woz", "cadastre"]
|
values: ["Funda", "WOZ"]
|
||||||
- name: price_status
|
- name: price_status
|
||||||
description: Type of price event.
|
description: Type of price event.
|
||||||
data_type: text
|
data_type: text
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ packages:
|
|||||||
- package: dbt-labs/dbt_utils
|
- package: dbt-labs/dbt_utils
|
||||||
version: [">=1.0.0", "<2.0.0"]
|
version: [">=1.0.0", "<2.0.0"]
|
||||||
- package: elementary-data/elementary
|
- package: elementary-data/elementary
|
||||||
version: [">=0.16.0", "<0.17.0"]
|
version: [">=0.22.0", "<0.23.0"]
|
||||||
|
|||||||
Reference in New Issue
Block a user