e-galan commented on code in PR #37693:
URL: https://github.com/apache/airflow/pull/37693#discussion_r1562813483
##########
airflow/providers/google/cloud/sensors/dataflow.py:
##########
@@ -357,4 +500,45 @@ def poke(self, context: Context) -> bool:
location=self.location,
)
- return self.callback(result)
+ return result if self.callback is None else self.callback(result)
+
+ 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:
Review Comment:
@Lee-W we have already had this discussion earlier. I argued that it would
be better not to do this for 3 out of 4 sensors, because of the user-defined
`callback` parameter which could return arbitrary data types.
I implemented this suggestion for `DataflowJobStatusSensor` which does not
have this parameter.
--
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]