josh-fell commented on code in PR #48466:
URL: https://github.com/apache/airflow/pull/48466#discussion_r2061115600


##########
providers/dbt/cloud/src/airflow/providers/dbt/cloud/operators/dbt.py:
##########
@@ -213,7 +213,12 @@ def execute(self, context: Context):
                 ):
                     self.log.info("Job run %s has completed successfully.", 
self.run_id)
                 else:
-                    raise DbtCloudJobRunException(f"Job run {self.run_id} has 
failed or has been cancelled.")
+                    # Gather job run details (including run steps), so we can 
output the logs from each step
+                    run_details = self.hook.get_job_run(
+                        run_id=self.run_id, account_id=self.account_id, 
include_related=["run_steps"]
+                    ).json()["data"]
+
+                    raise DbtCloudJobRunDetailsException(self.run_id, 
run_details)

Review Comment:
   Quite frankly, the information provided in this new exception could just 
replace the existing `DbtCloudJobRunException`. The additional details could be 
useful regardless of how the job run fails even if it reaches a time out state. 
WDYT?
   
   If you agree, keeping the logic in hook still seems reasonable and it does 
interact with dbt Cloud itself.



-- 
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]

Reply via email to