Skip to content

Commit 93448ef

Browse files
committed
Removed some comments once tested in environment
1 parent 6eaea79 commit 93448ef

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

recordprocessor/src/utils_for_recordprocessor.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import json
55
from csv import DictReader
66
from io import BytesIO, TextIOWrapper
7-
from botocore.response import StreamingBody
87
from clients import s3_client, lambda_client, logger
98
from constants import SOURCE_BUCKET_NAME, FILE_NAME_PROC_LAMBDA_NAME
109

@@ -19,10 +18,7 @@ def get_environment() -> str:
1918
def get_csv_content_dict_reader(file_key: str) -> DictReader:
2019
"""Returns the requested file contents from the source bucket in the form of a DictReader"""
2120
response = s3_client.get_object(Bucket=SOURCE_BUCKET_NAME, Key=file_key)
22-
s3_object_body: StreamingBody = response["Body"]
23-
# Try to seek, otherwise fallback to creating 2 objects
24-
# Should test in real AWS in addition to moto
25-
s3_object_bytes_io = BytesIO(s3_object_body.read())
21+
s3_object_bytes_io = BytesIO(response["Body"].read())
2622
encoding = "utf-8" if is_utf8(s3_object_bytes_io, file_key) else "windows-1252"
2723
text_io = TextIOWrapper(s3_object_bytes_io, encoding=encoding, newline="")
2824
return DictReader(text_io, delimiter="|")

0 commit comments

Comments
 (0)