Lee-W commented on code in PR #39110:
URL: https://github.com/apache/airflow/pull/39110#discussion_r1582501970
##########
airflow/providers/databricks/triggers/databricks.py:
##########
@@ -84,21 +84,38 @@ async def run(self):
async with self.hook:
while True:
run_state = await self.hook.a_get_run_state(self.run_id)
- if run_state.is_terminal:
- yield TriggerEvent(
- {
- "run_id": self.run_id,
- "run_page_url": self.run_page_url,
- "run_state": run_state.to_json(),
- "repair_run": self.repair_run,
- }
+ notebook_error = None
+ if not run_state.is_terminal:
+ self.log.info(
+ "run-id %s in run state %s. sleeping for %s seconds",
+ self.run_id,
+ run_state,
+ self.polling_period_seconds,
)
- return
+ await asyncio.sleep(self.polling_period_seconds)
+ continue
- self.log.info(
- "run-id %s in run state %s. sleeping for %s seconds",
- self.run_id,
- run_state,
- self.polling_period_seconds,
+ if run_state.result_state == "FAILED":
+ run_info = await self.hook.a_get_run(self.run_id)
+ task_run_id = None
+ for task in run_info.get("tasks", []):
Review Comment:
Let's add a TODO here for
https://github.com/apache/airflow/pull/39110#discussion_r1581499582
--
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]