Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add explicit `-> Any` return type annotation to `.pin_read` and `.pin_download`

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
55/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
api

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

  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 rstudio/pins-python

Tutte le issue di rstudio/pins-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.