Skip to content

Commit

Permalink
fix: minor performance tweak (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgpayne authored Jan 16, 2023
1 parent 4386f0a commit 5575e9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tap_singer_jsonl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ def get_s3_file_lines(config):
bucket, prefix=prefix, accept_key=lambda key: fnmatch.fnmatch(key, "*.singer*")
):
logger.info(f"Reading S3 key: {key}")
file_name = ntpath.basename(str(key))
if key.endswith(".gz"):
content = gzip.decompress(content)
for count, line in enumerate(content.decode("utf-8").splitlines(keepends=True)):
file_name = ntpath.basename(str(key))
row_number = count + 1
yield (file_name, row_number, line)

Expand Down

0 comments on commit 5575e9d

Please sign in to comment.