From 168e95f428e8d28fec1f6cb53ad54b95857e26b6 Mon Sep 17 00:00:00 2001 From: boraberke Date: Tue, 4 Jun 2024 20:24:54 +0300 Subject: [PATCH 1/2] Pass value of `NON_TERMINAL_STATUSES` enum instead of itself --- airflow/providers/dbt/cloud/operators/dbt.py | 2 +- tests/providers/dbt/cloud/operators/test_dbt.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airflow/providers/dbt/cloud/operators/dbt.py b/airflow/providers/dbt/cloud/operators/dbt.py index 8e9f310ce8e5b..e67578d0b0131 100644 --- a/airflow/providers/dbt/cloud/operators/dbt.py +++ b/airflow/providers/dbt/cloud/operators/dbt.py @@ -135,7 +135,7 @@ def execute(self, context: Context): account_id=self.account_id, payload={ "job_definition_id": self.job_id, - "status__in": DbtCloudJobRunStatus.NON_TERMINAL_STATUSES, + "status__in": DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value, "order_by": "-created_at", }, ).json()["data"] diff --git a/tests/providers/dbt/cloud/operators/test_dbt.py b/tests/providers/dbt/cloud/operators/test_dbt.py index 2941c021baf44..d27253b40720d 100644 --- a/tests/providers/dbt/cloud/operators/test_dbt.py +++ b/tests/providers/dbt/cloud/operators/test_dbt.py @@ -374,7 +374,7 @@ def test_execute_no_wait_for_termination_and_reuse_existing_run( account_id=account_id, payload={ "job_definition_id": self.config["job_id"], - "status__in": DbtCloudJobRunStatus.NON_TERMINAL_STATUSES, + "status__in": DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value, "order_by": "-created_at", }, ) From 86f9432fee72167377847917c28bbd54820d8a0c Mon Sep 17 00:00:00 2001 From: boraberke Date: Tue, 4 Jun 2024 21:06:31 +0300 Subject: [PATCH 2/2] Pass `NON_TERMINAL_STATUSES` as string --- airflow/providers/dbt/cloud/operators/dbt.py | 2 +- tests/providers/dbt/cloud/operators/test_dbt.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airflow/providers/dbt/cloud/operators/dbt.py b/airflow/providers/dbt/cloud/operators/dbt.py index e67578d0b0131..18df34ce3ecd4 100644 --- a/airflow/providers/dbt/cloud/operators/dbt.py +++ b/airflow/providers/dbt/cloud/operators/dbt.py @@ -135,7 +135,7 @@ def execute(self, context: Context): account_id=self.account_id, payload={ "job_definition_id": self.job_id, - "status__in": DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value, + "status__in": str(list(DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value)), "order_by": "-created_at", }, ).json()["data"] diff --git a/tests/providers/dbt/cloud/operators/test_dbt.py b/tests/providers/dbt/cloud/operators/test_dbt.py index d27253b40720d..3b0c1dab0956d 100644 --- a/tests/providers/dbt/cloud/operators/test_dbt.py +++ b/tests/providers/dbt/cloud/operators/test_dbt.py @@ -374,7 +374,7 @@ def test_execute_no_wait_for_termination_and_reuse_existing_run( account_id=account_id, payload={ "job_definition_id": self.config["job_id"], - "status__in": DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value, + "status__in": str(list(DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value)), "order_by": "-created_at", }, )