nikitagrover19 commented on code in PR #37345:
URL: https://github.com/apache/beam/pull/37345#discussion_r3350751370
##########
sdks/python/apache_beam/io/gcp/pubsub.py:
##########
@@ -638,10 +639,13 @@ def __init__(self, transform):
def setup(self):
from google.cloud import pubsub
- self._pub_client = pubsub.PublisherClient(
- publisher_options=pubsub.types.PublisherOptions(
- enable_message_ordering=True,
- ))
+ if self.with_attributes:
Review Comment:
You're right, `with_attributes` was too broad a signal.
I've updated this to derive `with_ordering` from a new explicit
`enable_message_ordering` parameter on `WriteToPubSub`, so it's now tied
directly to whether ordering was requested rather than inferred from attributes.
This avoids enabling ordering unnecessarily when attributes are used without
an `ordering_key`.
Let me know if this approach looks good.
--
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]