Skip to content

Commit 97e34a6

Browse files
Merge pull request #1085 from horsto/s3_chunked
When retrieving data from S3, account for chunking
2 parents 4b1e129 + 1a4103a commit 97e34a6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Fixed - `.ipynb` output in tutorials is not visible in dark mode ([#1078](https://github.com/datajoint/datajoint-python/issues/1078)) PR [#1080](https://github.com/datajoint/datajoint-python/pull/1080)
66
- Changed - Readme to update links and include example pipeline image
77
- Changed - Docs to add landing page and update navigation
8+
- Changed - `.data` method to `.stream` in the `get()` method for S3 (external) objects PR [#1085](https://github.com/datajoint/datajoint-python/pull/1085)
89
- Fixed - Docs to rename `create_virtual_module` to `VirtualModule`
910

1011
### 0.14.0 -- Feb 13, 2023

datajoint/s3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ def fput(self, local_file, name, metadata=None):
6868
def get(self, name):
6969
logger.debug("get: {}:{}".format(self.bucket, name))
7070
try:
71-
return self.client.get_object(self.bucket, str(name)).data
71+
with self.client.get_object(self.bucket, str(name)) as result:
72+
data = [d for d in result.stream()]
73+
return b"".join(data)
7274
except minio.error.S3Error as e:
7375
if e.code == "NoSuchKey":
7476
raise errors.MissingExternalFile("Missing s3 key %s" % name)

0 commit comments

Comments
 (0)