boraberke commented on code in PR #38868:
URL: https://github.com/apache/airflow/pull/38868#discussion_r1626653075
##########
airflow/providers/dbt/cloud/hooks/dbt.py:
##########
@@ -439,6 +443,24 @@ def trigger_job_run(
}
payload.update(additional_run_config)
+ if retry_from_failure:
+ latest_run = self.get_job_runs(
+ account_id=account_id,
+ payload={
+ "job_definition_id": job_id,
+ "order_by": "-created_at",
+ "limit": 1,
+ },
+ ).json()["data"]
+ if latest_run and latest_run[0]["status"] ==
DbtCloudJobRunStatus.ERROR.value:
Review Comment:
Thank you for your feedback Josh! Really appreciated it!
On your suggestion, I don't think it should. When I checked a cancelled run
from api, it has `can_retry` parameter set to `false`, which means even if we
call `rerun` endpoint, it will run as normal run as explained by the
[api](https://docs.getdbt.com/dbt-cloud/api-v2#/operations/Retry%20Failed%20Job).
Below is an example data returned for a canceled job run:
```
"status": 30,
"status_humanized": "Cancelled",
"can_retry": false,
"retry_not_supported_reason": "RETRY_NOT_FAILED_RUN",
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]