Add explicit `-> Any` return type annotation to `.pin_read` and `.pin_download`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 55/100
Direzione di ricerca
Individua le definizioni di .pin_read e .pin_download, quindi esamina come vengono inferiti i relativi tipi di ritorno attuali da chiamate come load_data e pd.DataFrame. Aggiungi le annotazioni di ritorno typing.Any richieste e verifica che il controllo dei tipi non richieda più ai chiamanti di restringere i tipi di ritorno inferiti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
These functions are currently un-annotated, so some type checkers (e.g. pyright) will try to infer based on the underlying function calls like load_data and by extension function calls like pd.DataFrame.
It would be better if we explicitly annotated these with typing.Any since it would mean the type checker short-circuits this inference and wouldn't raise an error if the user fails to narrow down the type through case-checking from DataFrame | dict etc.
It would also play nicer with extension packages like geopins which extend the interface to give extra return types dynamically, which the type checker doesn't know about.
I understand that pins isn't typically used in the context of heavy-duty type checking but I think this is pretty easy thing to add and would make it more pleasant to work with in VS Code which usually does light pyright analysis via pylance.
I can put in a PR
- Lingua principale
- Python
- Stelle
- 59
- Fork
- 11
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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 rstudio/pins-python
-
.maint
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
rstudio/pins-python#280 ·
-
testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
rstudio/pins-python#196 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
rstudio/pins-python#354 ·
-
Pins ecosystem documentation Aperta.documentation
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
rstudio/pins-python#348 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
rstudio/pins-python#347 ·
Tutte le issue di rstudio/pins-python
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·