Skip to content

Commit

Permalink
Fix DbtCloudRunJobOperator to Use Correct Status Parameters for `re…
Browse files Browse the repository at this point in the history
…use_existing_run` (apache#40048)

* Pass value of `NON_TERMINAL_STATUSES` enum instead of itself

* Pass `NON_TERMINAL_STATUSES` as string
  • Loading branch information
boraberke authored and romsharon98 committed Jul 26, 2024
1 parent 7ebfe85 commit 82ed311
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion airflow/providers/dbt/cloud/operators/dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": str(list(DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value)),
"order_by": "-created_at",
},
).json()["data"]
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/dbt/cloud/operators/test_dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": str(list(DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value)),
"order_by": "-created_at",
},
)
Expand Down

0 comments on commit 82ed311

Please sign in to comment.