MaksYermak commented on code in PR #42080:
URL: https://github.com/apache/airflow/pull/42080#discussion_r1753853498
##########
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:
@gopidesupavan you are right, but now I don't understand what you want to
achieve with this PR. Because in an issue
https://github.com/apache/airflow/issues/41877 I see that the user wants to see
the same XCom result on deff and non-deff mode. If you add conversion in
trigger side then trigger returns string to `execute_complete` and after that a
`return` statement adds this value to XCom. As a result we will still have
different values on deff and non-deff mode.
Also, I see that in non-deff mode the result value depends on
`messages_callback` function
https://github.com/apache/airflow/blob/main/airflow/providers/google/cloud/sensors/pubsub.py#L146C1-L150C1
In this case for us it means that for consistent values we need to use
`handle_messages` function for conversion in deff mode either.
--
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]