Skip to content

Commit ac94d47

Browse files
author
leonard
committed
fix dbt-postgres needed version in github action
improve the assert checking that model were correctly build : now we check the status of the model, not it's time build that doesn't exist if the model failed
1 parent 70a7566 commit ac94d47

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

.github/workflows/test_integration_adapter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
profile:
2828
- postgres
2929
dbt_version:
30-
- "1.7.16"
30+
- "1.9.0"
3131
python:
3232
- "3.11"
3333
- "3.12"

projects/adapter/integration_tests/features/steps/fal_adapter_steps.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,11 @@ def set_project_folder(context, project: str):
7373

7474
@then("the following models are calculated in order")
7575
def check_model_results(context):
76-
models = _get_dated_dbt_models(context)
77-
sorted_models = sorted(models, key=lambda x: x[1])
78-
sorted_model_names = [model[0] for model in sorted_models]
79-
expected_model_names = context.table.headings
76+
models_result = _get_dated_dbt_models(context)
77+
expected_model_result = {model_id: "success" for model_id in context.table.headings}
8078
assert (
81-
sorted_model_names == expected_model_names
82-
), f"Expected {expected_model_names}, got {sorted_model_names}"
79+
models_result == expected_model_result
80+
), f"Expected {expected_model_result}, got {models_result}"
8381

8482

8583
@then('model {model_name} fails with message "{msg}"')
@@ -103,15 +101,10 @@ def check_compiled_model(context, model_type: str, model_name: str, msg: str):
103101

104102

105103
def _get_dated_dbt_models(context):
106-
return [
107-
(
108-
result["unique_id"].split(".")[-1],
109-
datetime.fromisoformat(
110-
result["timing"][-1]["completed_at"].replace("Z", "+00:00")
111-
),
112-
)
104+
return {
105+
result["unique_id"].split(".")[-1]: result["status"]
113106
for result in _load_dbt_result_file(context)
114-
]
107+
}
115108

116109

117110
def _load_dbt_result_file(context):

0 commit comments

Comments
 (0)