e-galan commented on code in PR #37693:
URL: https://github.com/apache/airflow/pull/37693#discussion_r1555567629
##########
airflow/providers/google/cloud/sensors/dataflow.py:
##########
@@ -115,10 +124,52 @@ def poke(self, context: Context) -> bool:
return False
+ def execute(self, context: Context) -> Any:
+ """Airflow runs this method on the worker and defers using the
trigger."""
+ if not self.deferrable:
+ super().execute(context)
+ else:
+ if self.poke(context=context):
+ return True
+ self.defer(
+ timeout=self.execution_timeout,
+ trigger=DataflowJobStatusTrigger(
+ job_id=self.job_id,
+ expected_statuses=self.expected_statuses,
+ project_id=self.project_id,
+ location=self.location,
+ gcp_conn_id=self.gcp_conn_id,
+ poll_sleep=self.poll_interval,
+ impersonation_chain=self.impersonation_chain,
+ ),
+ method_name="execute_complete",
+ )
+
+ def execute_complete(self, context: Context, event: dict[str, str | list])
-> Any:
Review Comment:
It won't. Fixed it, thanks.
--
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]