aboutsummaryrefslogtreecommitdiffstats
path: root/gdpr_obfuscator/read.py
diff options
context:
space:
mode:
authorAlex Schofield <git@ajschof.me>2025-02-20 19:16:07 +0000
committerAlex Schofield <git@ajschof.me>2025-02-20 19:16:07 +0000
commit04157bd1736b4997f549be8b79713448c2cceea3 (patch)
tree3c60494f3eed4e97f9ff6a4bcbb18f11179658e3 /gdpr_obfuscator/read.py
parentff3a5630fe5440f61fffc2b2732ba38fad2b67a7 (diff)
downloadgdpr-obfuscator-04157bd1736b4997f549be8b79713448c2cceea3.tar.gz
gdpr-obfuscator-04157bd1736b4997f549be8b79713448c2cceea3.zip
return byte stream from read_s3 using create_byte_stream method
Diffstat (limited to 'gdpr_obfuscator/read.py')
-rw-r--r--gdpr_obfuscator/read.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdpr_obfuscator/read.py b/gdpr_obfuscator/read.py
index b1ffc2f..8dd3e25 100644
--- a/gdpr_obfuscator/read.py
+++ b/gdpr_obfuscator/read.py
@@ -49,7 +49,8 @@ class DataReader:
response = client.get_object(Bucket=bucket, Key=key)
self.logger.info("S3 object read successfully")
content = response["Body"].read().decode("utf-8")
- return self.read_string(content)
+ read_csv_content = self.read_string(content)
+ return utils.create_byte_stream(read_csv_content)
except client.exceptions.NoSuchKey:
self.logger.error(f"Object not found: {bucket}/{key}")
raise
git.ajschof.me — hosted by ajschofield — powered by cgit