This is an automated email from the ASF dual-hosted git repository.
joshfell pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 5d227860ad Fix `DbtCloudRunJobOperator` to Use Correct Status
Parameters for `reuse_existing_run` (#40048)
5d227860ad is described below
commit 5d227860ad38db8afd724fb9d3d9607c9888683e
Author: Bora Berke Sahin <[email protected]>
AuthorDate: Tue Jun 4 23:19:19 2024 +0300
Fix `DbtCloudRunJobOperator` to Use Correct Status Parameters for
`reuse_existing_run` (#40048)
* Pass value of `NON_TERMINAL_STATUSES` enum instead of itself
* 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 8e9f310ce8..18df34ce3e 100644
--- a/airflow/providers/dbt/cloud/operators/dbt.py
+++ b/airflow/providers/dbt/cloud/operators/dbt.py
@@ -135,7 +135,7 @@ class DbtCloudRunJobOperator(BaseOperator):
account_id=self.account_id,
payload={
"job_definition_id": self.job_id,
- "status__in": DbtCloudJobRunStatus.NON_TERMINAL_STATUSES,
+ "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 2941c021ba..3b0c1dab09 100644
--- a/tests/providers/dbt/cloud/operators/test_dbt.py
+++ b/tests/providers/dbt/cloud/operators/test_dbt.py
@@ -374,7 +374,7 @@ class TestDbtCloudRunJobOperator:
account_id=account_id,
payload={
"job_definition_id": self.config["job_id"],
- "status__in": DbtCloudJobRunStatus.NON_TERMINAL_STATUSES,
+ "status__in":
str(list(DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value)),
"order_by": "-created_at",
},
)