Skip to content

Commit 178d15d

Browse files
Merge pull request #13 from matthewhanson/develop
publish 0.3.1
2 parents 09c10a1 + c6ed5c6 commit 178d15d

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [v0.3.1] = 2020-07-29
10+
11+
### Changed
12+
- s3.download() now uses boto3 download_file for multipart stream downloads to avoid memory errors downloading large files
13+
914
## [v0.3.0] = 2020-06-14
1015

1116
### Changed
@@ -77,7 +82,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7782
Initial Release
7883

7984
[Unreleased]: https://github.com/matthewhanson/boto3-utils/compare/master...develop
80-
[v0.3.0]: https://github.com/matthewhanson/boto3-utils/compare/0.3.0...0.2.3
85+
[v0.3.1]: https://github.com/matthewhanson/boto3-utils/compare/0.3.0...0.3.1
86+
[v0.3.0]: https://github.com/matthewhanson/boto3-utils/compare/0.2.3...0.3.0
8187
[v0.2.3]: https://github.com/matthewhanson/boto3-utils/compare/0.2.2...0.2.3
8288
[v0.2.2]: https://github.com/matthewhanson/boto3-utils/compare/0.2.1...0.2.2
8389
[v0.2.1]: https://github.com/matthewhanson/boto3-utils/compare/0.2.0...0.2.1

boto3utils/s3.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,10 @@ def download(self, uri, path=''):
124124
logger.debug("Downloading %s as %s" % (uri, fout))
125125
if path != '':
126126
makedirs(path, exist_ok=True)
127-
128-
response = self.get_object(s3_uri['bucket'], s3_uri['key'])
129-
130-
with open(fout, 'wb') as f:
131-
f.write(response['Body'].read())
127+
extra_args = None
128+
if self.requester_pays:
129+
extra_args = {'RequestPayer': 'requester'}
130+
self.s3.download_file(s3_uri['bucket'], s3_uri['key'], fout, ExtraArgs=extra_args)
132131
return fout
133132

134133
def read(self, url):

boto3utils/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.3.0'
1+
__version__ = '0.3.1'

0 commit comments

Comments
 (0)