LaPetiteSouris commented on code in PR #24554:
URL: https://github.com/apache/airflow/pull/24554#discussion_r902561291


##########
airflow/providers/amazon/aws/sensors/sqs.py:
##########
@@ -104,14 +104,13 @@ def __init__(
 
         self.hook: Optional[SqsHook] = None
 
-    def poke(self, context: 'Context'):
+    def poll_sqs(self, sqs_conn: Any) -> Iterable:

Review Comment:
   Changed to `airflow.providers.amazon.aws.hooks.base_aws import 
BaseAwsConnection`



##########
tests/system/providers/amazon/aws/example_sqs.py:
##########
@@ -66,6 +66,20 @@ def delete_queue(queue_url):
     )
     # [END howto_sensor_sqs]
 
+    # [START howto_sensor_sqs_batch]
+    # batch multiple messages from SQS.
+    # each SQS poll can retrieve no more than 10 messages
+    # due to requirements by AWS SQS
+    read_from_queue_in_batch = SqsBatchSensor(
+        task_id='read_from_queue_in_batch',
+        sqs_queue=create_queue,
+        # get maximum 10 messages each poll
+        max_messages=10,
+        # perform 3 polls before returning results
+        batch=3,
+    )
+    # [END howto_sensor_sqs_batch]
+

Review Comment:
   done



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