You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/06/04 21:58:15 UTC

[GitHub] [airflow] potiuk commented on a diff in pull request #31691: introducing a default method for deferrable continuation

potiuk commented on code in PR #31691:
URL: https://github.com/apache/airflow/pull/31691#discussion_r1217188957


##########
airflow/providers/amazon/aws/triggers/glue_crawler.py:
##########
@@ -68,11 +68,8 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
                     break  # we reach this point only if the waiter met a success criteria
                 except WaiterError as error:
                     if "terminal failure" in str(error):
-                        yield TriggerEvent(
-                            {"status": "failure", "message": f"Glue Crawler creation Failed: {error}"}
-                        )
-                        break
+                        raise
                     self.log.info("Status of glue crawl is %s", error.last_response["Crawler"]["State"])
                     await asyncio.sleep(int(self.poll_interval))
 
-        yield TriggerEvent({"status": "success", "message": "Crawl Complete"})
+        yield TriggerEvent.success(self.crawler_name)

Review Comment:
   Yes. The way how to use it until 2.7+ (which is not multiple years, but 12 months since we release 2.7) - there has to be a back-compatible way of using it. Unfortunately, vack compatibility of core classses is important.
   
   I think the code to use hte "success" should fall-back to hard-coded version of it.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org