Lee-W commented on code in PR #37693:
URL: https://github.com/apache/airflow/pull/37693#discussion_r1562755723


##########
airflow/providers/google/cloud/sensors/dataflow.py:
##########
@@ -194,27 +246,72 @@ def poke(self, context: Context) -> bool:
             project_id=self.project_id,
             location=self.location,
         )
+        return result["metrics"] if self.callback is None else 
self.callback(result["metrics"])
+
+    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:
   Hi @e-galan , would it be possisble for us to change this way for this 
operator? Or is there anything I missed?



##########
airflow/providers/google/cloud/sensors/dataflow.py:
##########
@@ -276,26 +373,72 @@ 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:
   same here



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to