Lee-W commented on code in PR #39110:
URL: https://github.com/apache/airflow/pull/39110#discussion_r1580744308


##########
airflow/providers/databricks/triggers/databricks.py:
##########
@@ -84,13 +84,30 @@ async def run(self):
         async with self.hook:
             while True:
                 run_state = await self.hook.a_get_run_state(self.run_id)
+                notebook_error = None
                 if run_state.is_terminal:
+                    if run_state.result_state == "FAILED":
+                        run_info = await self.hook.a_get_run(self.run_id)
+                        task_run_id = None
+                        if "tasks" in run_info:
+                            for task in run_info["tasks"]:
+                                if task.get("state", {}).get("result_state", 
"") == "FAILED":
+                                    task_run_id = task["run_id"]
+                        if task_run_id is not None:

Review Comment:
   Adding the non-deferrable part of it to this PR might be a bit huge. That 
why I'm proposing another PR for this fix



##########
airflow/providers/databricks/triggers/databricks.py:
##########
@@ -84,13 +84,30 @@ async def run(self):
         async with self.hook:
             while True:
                 run_state = await self.hook.a_get_run_state(self.run_id)
+                notebook_error = None
                 if run_state.is_terminal:
+                    if run_state.result_state == "FAILED":
+                        run_info = await self.hook.a_get_run(self.run_id)
+                        task_run_id = None
+                        if "tasks" in run_info:
+                            for task in run_info["tasks"]:
+                                if task.get("state", {}).get("result_state", 
"") == "FAILED":
+                                    task_run_id = task["run_id"]
+                        if task_run_id is not None:

Review Comment:
   regarding to this, I'm thinking of keeping it as it is now (not collecting 
the error message) for keeping the behavior consistent. We can create another 
issue and PR for fixing both non-deferrable and deferrable all along. WDYT?



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