wip
This commit is contained in:
20
batch-jobs/app/events/csv_chunks.py
Normal file
20
batch-jobs/app/events/csv_chunks.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import boto3
|
||||
from aws_lambda_powertools.utilities.data_classes import (
|
||||
EventBridgeEvent,
|
||||
event_source,
|
||||
)
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
|
||||
from csv_utils import byte_ranges
|
||||
|
||||
CHUNK_SIZE = 50
|
||||
s3_client = boto3.client('s3')
|
||||
|
||||
|
||||
@event_source(data_class=EventBridgeEvent)
|
||||
def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
new_image = event.detail['new_image']
|
||||
csvfile = new_image['csv_s3uri']
|
||||
pairs = byte_ranges(csvfile, CHUNK_SIZE)
|
||||
|
||||
return True
|
||||
Reference in New Issue
Block a user