Allow chunked uploads (and maybe even streaming uploads)
まだ誰も着手していません。
評価
調査の方向性
dropbox_client.py の 533-539 行付近から始めます。ここではリクエストボディが 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
- スター
- 983
- フォーク
- 331
- 平均マージ
- 3分
- マージ済み PR(30日)
- 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dropbox/dropbox-sdk-python のほかの issue
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
dropbox/dropbox-sdk-python#585 · コメント 4 件 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
dropbox/dropbox-sdk-python#491 · コメント 1 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
dropbox/dropbox-sdk-python#482 · コメント 1 件 · リアクション 2 件 ·
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
dropbox/dropbox-sdk-python#476 · コメント 3 件 ·
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
dropbox/dropbox-sdk-python#475 · コメント 1 件 ·
dropbox/dropbox-sdk-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·