jcamatta opened a new pull request, #37364: URL: https://github.com/apache/airflow/pull/37364
Added an 'elif' block in the 'async def run(self)' method of 'TemplateJobStartTrigger', which captures 'JOB_STATE_CANCELLED'. This prevents the triggerer from looping indefinitely when a dataflow is cancelled. This also required updating the 'execute_complete' method of both 'DataflowStartFlexTemplateOperator' and 'DataflowTemplatedJobStartOperator', which now raise an 'AirflowException(event["message"])' when the job has the status "cancelled". So, if you cancel the job in the Google console, this will be reflected in the Airflow task execution. Added 'pool_sleep' as an optional argument to the constructor of 'DataflowStartFlexTemplateOperator', preserving its default value of 10 seconds. This argument is passed to the 'TemplateJobStartTrigger' constructor when the 'self.defer' method is called in 'execute'. Adding a test is very challenging because it requires a FlexTemplate and ClassicTemplate. Then, one must manually cancel it or use the REST API, and observe if this is reflected in the job. -- 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]
