diff --git a/tests/functional/iceberg/test_incremental_models.py b/tests/functional/iceberg/test_incremental_models.py index a02d9ffed..f8f1d6b89 100644 --- a/tests/functional/iceberg/test_incremental_models.py +++ b/tests/functional/iceberg/test_incremental_models.py @@ -1,4 +1,5 @@ import pytest +import time from pathlib import Path @@ -57,6 +58,8 @@ class TestIcebergIncrementalStrategies: + append: str = f"append_{hash(time.time())}" + @pytest.fixture(scope="class") def project_config_update(self): return {"flags": {"enable_iceberg_materializations": True}} @@ -76,15 +79,11 @@ def setup_class(self, project): def models(self): return { "upstream_table.sql": _MODEL_BASIC_TABLE_MODEL, - "append.sql": _MODEL_INCREMENTAL_ICEBERG_APPEND, + f"{self.append}.sql": _MODEL_INCREMENTAL_ICEBERG_APPEND, "merge.sql": _MODEL_INCREMENTAL_ICEBERG_MERGE, "delete_insert.sql": _MODEL_INCREMENTAL_ICEBERG_DELETE_INSERT, } - def test_incremental_strategies_build(self, project, setup_class): - run_results = run_dbt() - assert len(run_results) == 4 - def __check_correct_operations(self, model_name, /, rows_affected, status="SUCCESS"): run_results = run_dbt( ["show", "--inline", f"select * from {{{{ ref('{model_name}') }}}} where world_id = 4"] @@ -92,7 +91,7 @@ def __check_correct_operations(self, model_name, /, rows_affected, status="SUCCE assert run_results[0].adapter_response["rows_affected"] == rows_affected assert run_results[0].adapter_response["code"] == status - if model_name != "append": + if "append" not in model_name: run_results, stdout = run_dbt_and_capture( [ "show", @@ -118,9 +117,9 @@ def test_incremental_strategies_with_update(self, project, setup_class): ) ) - run_results = run_dbt(["run", "-s", "append", "merge", "delete_insert"]) + run_results = run_dbt(["run", "-s", self.append, "merge", "delete_insert"]) assert len(run_results) == 3 - self.__check_correct_operations("append", rows_affected=3) + self.__check_correct_operations(self.append, rows_affected=2) self.__check_correct_operations("merge", rows_affected=1) self.__check_correct_operations("delete_insert", rows_affected=1)