Make more operations in AsyncLocalFileSystem actually async

Aperta
#81 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start by reading AsyncLocalFileSystem and the async file methods named in the issue: _write_text, _write_bytes, _read_text, _read_bytes, _put_file, and _pipe_file; compare them with AsyncFileSystem.open_async and the synchronous defaults in AbstractFileSystem. The issue leaves the design open: decide whether these should use open_async directly or be added as base defaults. Done means the applicable operations use async file I/O and have tests covering their behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Thanks for providing this library. I use fsspec in a few projects (mostly via universal-pathlib) which are async and it's great to have an async option for local usage in order to have a consistent API.

Something I noticed in the AsyncLocalFileSystem implementation is that most operations, even those related to file io (rather than file-system io) aren't using aiofile when it appears that they could. I'm thinking of things like _write_text[^1], which doesn't use the open_async due to the methods they wrap calling AbstractFileSystem.open (which is synchronous).

Perhaps I'm missing something, however this feels like a missed opportunity to make the most of aiofile offering a complete async file interface.

I noticed that the base AsyncFileSystem doesn't implement those methods in terms of open_async as AbstractFileSystem does for open, so perhaps there's something I'm missing which makes that undesirable? And/or is this something which would be better fixed by implementing them there as defaults, rather than requiring every async implementation to build them from scratch?

Would you be open to a PR which added this support?

[^1]: _write_text, _write_bytes, _read_text, _read_bytes, _put_file, _pipe_file.

Lingua principale
Python
Stelle
18
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di iterative/morefs

Tutte le issue di iterative/morefs

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.