diff --git a/data_platform/ops/elementary.py b/data_platform/ops/elementary.py index 0bd8a8e..48c494d 100644 --- a/data_platform/ops/elementary.py +++ b/data_platform/ops/elementary.py @@ -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) diff --git a/dbt/macros/elementary_compat.sql b/dbt/macros/elementary_compat.sql new file mode 100644 index 0000000..b025ee7 --- /dev/null +++ b/dbt/macros/elementary_compat.sql @@ -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 %} diff --git a/dbt/models/staging/sources.yml b/dbt/models/staging/sources.yml index 11a09c8..8d696ff 100644 --- a/dbt/models/staging/sources.yml +++ b/dbt/models/staging/sources.yml @@ -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: diff --git a/dbt/models/staging/stg_funda_listings.yml b/dbt/models/staging/stg_funda_listings.yml index d8c2cd5..803f1d0 100644 --- a/dbt/models/staging/stg_funda_listings.yml +++ b/dbt/models/staging/stg_funda_listings.yml @@ -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². diff --git a/dbt/models/staging/stg_funda_price_history.yml b/dbt/models/staging/stg_funda_price_history.yml index f0d2bc0..32c6d2c 100644 --- a/dbt/models/staging/stg_funda_price_history.yml +++ b/dbt/models/staging/stg_funda_price_history.yml @@ -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 diff --git a/dbt/packages.yml b/dbt/packages.yml index c44cc12..b7d9aec 100644 --- a/dbt/packages.yml +++ b/dbt/packages.yml @@ -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"]