Allow chunked uploads (and maybe even streaming uploads)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 50/100
Direzione di ricerca
Inizia in dropbox_client.py intorno alle righe 533-539, dove i corpi delle richieste sono limitati a bytes, e confronta questo comportamento con la documentazione collegata di Requests sullo streaming e sui caricamenti a blocchi. Determina come l'SDK dovrebbe accettare oggetti simili a file o generatori, documentando anche il comportamento dei tentativi e del riavvolgimento; il lavoro è completato quando le forme di caricamento scelte sono supportate senza l'attuale restrizione ai soli bytes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 983
- Fork
- 331
- Merge medio
- 3m
- PR unite (30g)
- 10
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dropbox/dropbox-sdk-python
-
question
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
dropbox/dropbox-sdk-python#585 · 4 commenti ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
dropbox/dropbox-sdk-python#491 · 1 commento ·
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
dropbox/dropbox-sdk-python#482 · 1 commento · 2 reazioni ·
-
question
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
dropbox/dropbox-sdk-python#476 · 3 commenti ·
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
dropbox/dropbox-sdk-python#475 · 1 commento ·
Tutte le issue di dropbox/dropbox-sdk-python
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
canonical/paas-charm#368 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
addition to tracking list Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
StevenBlack/hosts#3256 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
qualcomm/qai-appbuilder#275 ·