Conversation
- Split `get_stream_chunk` into `get_stream_chunk` (bytes, uses `bytearray` internally) and `get_stream_chunk_str`, removing 5 redundant helper functions - Replace `on_chunk_received` with niquests `on_upload` hook in `s3_put_object`, `s3_multipart_upload`, and `s3_file_upload` for fine-grained byte-level upload progress - Make `S3Session` fields (`endpoint_url`, `access_key`, `secret_key`, `region`) optional, falling back to botocore defaults - Widen `s3_put_object` and `upload_part` to accept `bytes | bytearray`
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
WalkthroughThe pull request refactors the upload callback mechanism from Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Ousret
reviewed
Feb 26, 2026
Replace bytearray (extend + slice) with a deque-based `BytesBuffer` adapted from urllib3's `BytesQueueBuffer`. O(1) appends with no copy, memoryview-based splitting at chunk boundaries. 3-5x faster for medium/large chunks (64KB-1MB) typical of S3 multipart uploads.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_stream_chunkintoget_stream_chunk(bytes, usesbytearrayinternally) andget_stream_chunk_str, removing 5 redundant helper functionson_chunk_receivedwith niquestson_uploadhook ins3_put_object,s3_multipart_upload, ands3_file_uploadfor fine-grained byte-level upload progressS3Sessionfields (endpoint_url,access_key,secret_key,region) optional, falling back to botocore defaultss3_put_objectandupload_partto acceptbytes | bytearraySummary by CodeRabbit
New Features
Tests