You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/09/22 10:34:27 UTC

[GitHub] [airflow] Taragolis commented on a diff in pull request #26543: Added KinesisHook to kinesis.py

Taragolis commented on code in PR #26543:
URL: https://github.com/apache/airflow/pull/26543#discussion_r977489350


##########
airflow/providers/amazon/aws/hooks/kinesis.py:
##########
@@ -44,3 +44,41 @@ def __init__(self, delivery_stream: str, *args, **kwargs) -> None:
     def put_records(self, records: Iterable):
         """Write batch records to Kinesis Firehose"""
         return self.get_conn().put_record_batch(DeliveryStreamName=self.delivery_stream, Records=records)
+
+
+class KinesisHook(AwsBaseHook):
+    """
+    Interact with AWS Kinesis Data Stream.
+
+    Additional arguments (such as ``aws_conn_id``) may be specified and
+    are passed down to the underlying AwsBaseHook.
+
+    :param delivery_stream: Name of the data stream
+
+    AWS Kinesis docs: https://docs.aws.amazon.com/streams/latest/dev/introduction.html
+
+    .. seealso::
+        :class:`~airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
+    """
+
+    def __init__(self, delivery_stream: str, *args, **kwargs) -> None:
+        self.delivery_stream = delivery_stream

Review Comment:
   Might be better move `delivery_stream` to a `put_records` argument. This allow keep AWS Hooks as simple thin wrapper for specific `boto3.client`



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org