uranusjr commented on code in PR #27775:
URL: https://github.com/apache/airflow/pull/27775#discussion_r1027637384


##########
airflow/providers/google/cloud/hooks/pubsub.py:
##########
@@ -537,12 +537,10 @@ def acknowledge(
             individual attempt.
         :param metadata: (Optional) Additional metadata that is provided to 
the method.
         """
-        if ack_ids is not None and messages is None:
-            pass
-        elif ack_ids is None and messages is not None:
-            ack_ids = [message.ack_id for message in messages]
-        else:
+        if not (ack_ids is None) ^ (messages is None):
             raise ValueError("One and only one of 'ack_ids' and 'messages' 
arguments have to be provided")
+        elif ack_ids is None:
+            ack_ids = [message.ack_id for message in messages]  # type: 
ignore[union-attr]

Review Comment:
   I kind of like the old code actually, it’s a little easier to reason with, 
but that may be subjective.



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