pytask-dev / pytask-dev/pytask
ENH: add some more common Nodes
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 146
- Fork
- 14
- Merge medio
- 3g 16h
- PR unite (30g)
- 34
Descrizione
Writing pandas dataframes to disk seems really common. I am going to have to write my own DFNode class for this. Would you like me to generalize it enough and then contribute it here?
I would imagine something like
class DFNode:
def __init__(self, path: str | ..., kind: Literal["csv", "parquet", ...], load_kwargs: dict[str, Any = {}, save_kwargs: dict[str, Any]):
self.path = path
self.kind = kind
self.load_kwargs = load_kwargs
self.save_kwargs = save_kwargs
def save(self, value: Any) -> None:
saver = getattr(value, f"to_{self.kind}")
saver(self.path, **self.save_kwargs)
def load(self, is_product: bool) -> Any:
if is_product:
return self
loader = getattr(pd, f"read_{self.kind}")
return loader(self.path, **self.load_kwargs)
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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.
Direzione di ricerca
The issue provides a proposed DFNode class but names no repository files, tests, or entry point. Start by reviewing the existing Node abstractions and pandas read_* and to_* conventions; the work would be complete when the project has an agreed, tested way to read and write common dataframe formats with load and save options.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- pandas, python
- Ambito
- data
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100