Allow chunked uploads (and maybe even streaming uploads)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
Bắt đầu trong dropbox_client.py quanh các dòng 533-539, nơi phần thân của request bị giới hạn ở bytes, và so sánh hành vi đó với tài liệu Requests được liên kết về streaming và tải lên theo từng phần. Xác định SDK nên chấp nhận các đối tượng dạng tệp hoặc generator như thế nào, đồng thời ghi lại hành vi khi retry và rewind; được xem là hoàn tất khi các dạng upload đã chọn được hỗ trợ mà không còn giới hạn hiện tại chỉ chấp nhận bytes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Why is this feature valuable to you? Does it solve a problem you're having?
The requests library allows both streaming and chunked uploads (see https://requests.readthedocs.io/en/latest/user/advanced/#streaming-uploads and https://requests.readthedocs.io/en/latest/user/advanced/#chunk-encoded-requests). This has two benefits:
- It is sufficient to only load small parts of a file into memory before upload.
- It is possible to limit bandwidth usage by using a generator that provides chunks at a limited rate.
The Dropbox API of course already requires upload sessions (files/upload_session_start, files/upload_session_append and files/upload_session_finish) to upload files > 150 MB. However, this approach by itself does not replace chunked or streaming uploads because:
- The request body should be ideally >= 4 MB to reduce the total number of API calls (both for efficiency and to not exhaust data transport API call limits).
- Bandwidth control will be very coarse when performed on chunks of 4 MB compared for example 2 kB.
- Memory usage will still be larger compared to 1 kB or 2 kB chunks, especially for parallel uploads.
Describe the solution you'd like
Requests supports streaming uploads by passing a file-like object as the request body and chunked uploads by passing a generator as the request body. However, the Python SDK explicitly prevents both by requiring the request body to be of type bytes:
It would be good to either completely drop this limitation, with appropriate warnings in the doc string, or at least allow chunked uploads (where requests handles retry / rewind logic) even when disallowing streaming uploads.
Describe alternatives you've considered
Not at present.
- Ngôn ngữ chính
- Python
- Star
- 983
- Fork
- 331
- Merge trung bình
- 3 phút
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dropbox/dropbox-sdk-python
-
question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
dropbox/dropbox-sdk-python#585 · 4 bình luận ·
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
dropbox/dropbox-sdk-python#491 · 1 bình luận ·
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
dropbox/dropbox-sdk-python#482 · 1 bình luận · 2 reaction ·
-
question
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
dropbox/dropbox-sdk-python#476 · 3 bình luận ·
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
dropbox/dropbox-sdk-python#475 · 1 bình luận ·
Tất cả issue của dropbox/dropbox-sdk-python
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100