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


##########
airflow/providers/google/cloud/triggers/pubsub.py:
##########
@@ -106,7 +106,10 @@ async def run(self) -> AsyncIterator[TriggerEvent]:  # 
type: ignore[override]
                 ):
                     if self.ack_messages:
                         await self.message_acknowledgement(pulled_messages)
-                    yield TriggerEvent({"status": "success", "message": 
pulled_messages})
+
+                    messages_json = [ReceivedMessage.to_dict(m) for m in 
pulled_messages]

Review Comment:
   yes agree, if user provides `messages_callback` it still produces 
differences. 
   
   if the user doesn't provide any `messages_callback` there is default 
conversion sensors uses 
https://github.com/apache/airflow/blob/main/airflow/providers/google/cloud/sensors/pubsub.py#L189,
 so
   Am thinking atleast the default message response should sync in deff/non 
deff mode and proper formatted xcom result,  IMHO if user uses deferrable mode 
the message can not be used as it is completely unformatted.
   
    I can add a note to the doc without `messages_callback` it produces same 
result to xcom something like this? 



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