Skip to content

Commit

Permalink
Fix kinesis docstring examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bbayles authored Oct 20, 2023
1 parent 0bdfd29 commit 5a9b6b3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions boto3_helpers/kinesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ def yield_available_shard_records(kinesis_client=None, **kwargs):
from datetime import datetime, timedelta, timezone
from boto3_helpers.kinesis import yield_available_shard_records
for record in yield_available_shard_records('example-stream', 'shard-0001'):
print(record['SequenceNumber], record['Data], sep='\t')
for record in yield_available_shard_records(
StreamName='example-stream', 'shard-0001'
):
print(record['SequenceNumber'], record['Data'], sep='\t')
"""
kinesis_client = kinesis_client or boto3_client('kinesis')
Expand Down Expand Up @@ -100,7 +102,7 @@ def yield_available_stream_records(kinesis_client=None, **kwargs):
from boto3_helpers.kinesis import yield_available_stream_records
for record in yield_available_stream_records(StreamName='example-stream'):
print(record['SequenceNumber], record['Data], sep='\t')
print(record['SequenceNumber'], record['Data'], sep='\t')
Reading from a particular timestamp:
Expand All @@ -110,11 +112,11 @@ def yield_available_stream_records(kinesis_client=None, **kwargs):
from boto3_helpers.kinesis import yield_available_stream_records
for record in yield_available_stream_records(
'example-stream',
StreamName='example-stream',
ShardIteratorType='AT_TIMESTAMP',
Timestamp=datetime.now(timezone.utc) - timedelta(hours=1),
):
print(record['SequenceNumber], record['Data], sep='\t')
print(record['SequenceNumber'], record['Data'], sep='\t')
.. note::
Expand Down

0 comments on commit 5a9b6b3

Please sign in to comment.