diff --git a/producer/dbt/scenarios/csv_to_postgres/events/analytics/data_quality_event.json b/producer/dbt/scenarios/csv_to_postgres/events/analytics/data_quality_event.json index 685d2861..c8fe1696 100644 --- a/producer/dbt/scenarios/csv_to_postgres/events/analytics/data_quality_event.json +++ b/producer/dbt/scenarios/csv_to_postgres/events/analytics/data_quality_event.json @@ -10,7 +10,7 @@ "namespace": "postgres://localhost:5432", "facets": { "dataQualityAssertions": { - "assertions": [ + "{{ unordered_list(result, 'assertions') }}": [ { "assertion": "not_null", "name": "not_null_customer_analytics_total_revenue", diff --git a/producer/dbt/scenarios/csv_to_postgres/events/customers/data_quality_event.json b/producer/dbt/scenarios/csv_to_postgres/events/customers/data_quality_event.json index 1a52b933..9500aaf4 100644 --- a/producer/dbt/scenarios/csv_to_postgres/events/customers/data_quality_event.json +++ b/producer/dbt/scenarios/csv_to_postgres/events/customers/data_quality_event.json @@ -10,7 +10,7 @@ "namespace": "postgres://localhost:5432", "facets": { "dataQualityAssertions": { - "assertions": [ + "{{ unordered_list(result, 'assertions') }}": [ { "assertion": "not_null", "name": "not_null_stg_customers_customer_id", diff --git a/producer/dbt/scenarios/csv_to_postgres/events/orders/data_quality_event.json b/producer/dbt/scenarios/csv_to_postgres/events/orders/data_quality_event.json index ba5ebe7d..56e6d643 100644 --- a/producer/dbt/scenarios/csv_to_postgres/events/orders/data_quality_event.json +++ b/producer/dbt/scenarios/csv_to_postgres/events/orders/data_quality_event.json @@ -10,7 +10,7 @@ "namespace": "postgres://localhost:5432", "facets": { "dataQualityAssertions": { - "assertions": [ + "{{ unordered_list(result, 'assertions') }}": [ { "assertion": "not_null", "name": "not_null_stg_orders_customer_id", diff --git a/scripts/compare_events.py b/scripts/compare_events.py index e358098f..cf960384 100644 --- a/scripts/compare_events.py +++ b/scripts/compare_events.py @@ -1,6 +1,7 @@ # Copyright 2018-2024 contributors to the OpenLineage project # SPDX-License-Identifier: Apache-2.0 +import builtins import json import logging import os @@ -115,7 +116,8 @@ def diff(expected, result, prefix="", function=None) -> list: else: if function == "unordered_list": for i, x in enumerate(expected): - if not any(r for r in result if diff(x, r, f"{prefix}.[{i}]") is []): + # builtins.any: this module defines its own any() as a jinja helper + if not builtins.any(diff(x, r, f"{prefix}.[{i}]") == [] for r in result): errors.append(f"In {prefix}.[{i}], no matching elements") else: for i, x in enumerate(expected):