gopidesupavan commented on code in PR #42080:
URL: https://github.com/apache/airflow/pull/42080#discussion_r1770741269


##########
airflow/providers/google/cloud/sensors/pubsub.py:
##########
@@ -170,22 +171,41 @@ def execute(self, context: Context) -> None:
                     subscription=self.subscription,
                     max_messages=self.max_messages,
                     ack_messages=self.ack_messages,
-                    messages_callback=self.messages_callback,
                     poke_interval=self.poke_interval,
                     gcp_conn_id=self.gcp_conn_id,
                     impersonation_chain=self.impersonation_chain,
                 ),
                 method_name="execute_complete",
             )
 
-    def execute_complete(self, context: dict[str, Any], event: dict[str, str | 
list[str]]) -> str | list[str]:
+    def execute_complete(self, context: Context, event: dict[str, str | 
list[str]]) -> Any:
         """Return immediately and relies on trigger to throw a success event. 
Callback for the trigger."""
         if event["status"] == "success":
             self.log.info("Sensor pulls messages: %s", event["message"])
+            if self.messages_callback:
+                received_message_fmt = 
self._convert_to_received_message(event["message"])

Review Comment:
   We need to convert back to the original pubsub response type to work with 
user `messages_callback`, the event received from the trigger is list[dict].



-- 
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]

Reply via email to