Allow chunked uploads (and maybe even streaming uploads)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 dropbox_client.py 第 533-539 行附近开始,这里 request body 被限制为 bytes;将该行为与链接的 Requests 流式传输和分块上传文档进行比较。确定 SDK 应如何接受类文件对象或生成器,同时记录重试和回退行为;当所选的上传形式在不受当前仅限 bytes 的限制下得到支持时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 986
- 派生
- 332
- 平均合并
- 1 小时 54 分钟
- 30 天内合并 PR
- 10
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dropbox/dropbox-sdk-python 的其他 Issue
-
question
难度 4/5 3-5 天 新手友好度 35/100
dropbox/dropbox-sdk-python#585 · 4 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
dropbox/dropbox-sdk-python#491 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
dropbox/dropbox-sdk-python#482 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
question
难度 5/5 一周以上 新手友好度 25/100
dropbox/dropbox-sdk-python#476 · 3 条评论 ·
维护者通常 1 天内回复
-
bug
难度 5/5 一周以上 新手友好度 20/100
dropbox/dropbox-sdk-python#475 · 1 条评论 ·
维护者通常 1 天内回复
查看 dropbox/dropbox-sdk-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
BasedHardware/omi#20271 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 92/100
openai/openai-cookbook#3153 ·
维护者通常 1 天内回复
-
cvss-severity:high devguard l3montree-cybersecurity/devguard/devguard pkg:golang/github.com/l3montree-dev/devguard risk:low state:open
难度 2/5 1-3 小时 新手友好度 65/100
l3montree-dev/devguard#3146 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 76/100
open-webui/open-webui#31849 · 2 条评论 ·
维护者通常 1 天内回复