-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request compression #2959
request compression #2959
Conversation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## develop #2959 +/- ##
===========================================
+ Coverage 93.36% 93.41% +0.05%
===========================================
Files 65 66 +1
Lines 13841 13948 +107
===========================================
+ Hits 12923 13030 +107
Misses 918 918
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I focused on how config values are handled and the AWSRequestCompressor
class so far. Taking a break now and will continue with the other parts in the next review session.
ff749a1
to
0680e36
Compare
d3a007f
to
7f2a51f
Compare
084193d
to
9ef2d48
Compare
9ef2d48
to
d4bbb0e
Compare
141b796
to
6e08cee
Compare
9f6a7bc
to
f841379
Compare
f841379
to
4011831
Compare
One minor comment, but once tests pass, I think this should be set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good pending passing tests, thanks @dlm6693!
* release-1.31.14: Bumping version to 1.31.14 Update to latest models request compression (#2959)
This is a port of this pull request from the botocore repository: boto/botocore#2959
This pull request enables request compression in the AWS Python SDK. It is on by default, but only used if the
requestcompression
trait is attached to the operation being called. At the moment, the only compression algorithm supported isgzip
, but this is subject to change in the future. This also addresses a few typos I discovered while working on this project. Below is a summary of the new features in this PR.request_min_compression_size_bytes
setting toConfig
object and config file, and support forAWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES
environment variable.10240
. The value MUST be a parseable integer between 0 and 1048576 (1024**2).disable_request_compression
setting toConfig
object and config file, and support forAWS_DISABLE_REQUEST_COMPRESSION
environment variable.False
. If not a parseable boolean, the value will be coerced toFalse
, similar to other config settings that are boolean types in botocore.request_compression
property toOperationModel
. This will allow the SDK to check for the presence of this operation trait and run compression if so.compress.py
file. This file contains logic that is actually responsible for compressing requests. It has one public API:maybe_compress_request
: This checks whether compression should be performed, actually does compression if so and injects the correspondingContent-Encoding
header if needed.str
,bytes
,bytearray
, and file-like objects likeio.StringIO
andio.BytesIO
for example.BaseClient._make_api_call
signature_version
to bev2
query
protocol, dictionary bodies are serialized to bytes if the operation supports compression and the customer hasn't explicitly disabled compression.