Skip to content

Commit

Permalink
config S3 chunk size with internal env var
Browse files Browse the repository at this point in the history
  • Loading branch information
saikonen committed May 27, 2024
1 parent da2ad85 commit a024c05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion metaflow/plugins/datastores/s3_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from metaflow.datastore.datastore_storage import CloseAfterUse, DataStoreStorage


S3_CHUNK_SIZE = int(os.environ.get("_S3_CHUNK_SIZE", 1024**2))

try:
# python2
from urlparse import urlparse
Expand Down Expand Up @@ -151,7 +153,7 @@ def iter_results():

return CloseAfterUse(iter_results(), closer=s3)

def stream_bytes(self, paths, chunk_size=2**1024):
def stream_bytes(self, paths, chunk_size=S3_CHUNK_SIZE):
if len(paths) == 0:
return CloseAfterUse(iter([]))

Expand Down

0 comments on commit a024c05

Please sign in to comment.