Add explicit `-> Any` return type annotation to `.pin_read` and `.pin_download`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 55/100
Línea de trabajo
Localiza las definiciones de .pin_read y .pin_download, y luego inspecciona cómo se infieren sus tipos de retorno actuales a partir de llamadas como load_data y pd.DataFrame. Añade las anotaciones de retorno typing.Any solicitadas y verifica que la comprobación de tipos ya no requiera que los llamadores restrinjan los tipos de retorno inferidos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 59
- Forks
- 11
- Merge medio
- 1 h 9 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rstudio/pins-python
-
.maint
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
rstudio/pins-python#280 ·
-
Test board github with a tokenAbiertotesting
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
rstudio/pins-python#196 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
rstudio/pins-python#354 ·
-
Pins ecosystem documentationAbierto.documentation
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
rstudio/pins-python#348 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 48/100
rstudio/pins-python#347 ·
Todos los issues de rstudio/pins-python
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
QuantEcon/lecture-python-programming#642 ·
Los mantenedores suelen responder en 1 día
-
area/config area/profiles comp/cli needs-decision P3 sweeper:risk-compatibility type/feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NousResearch/hermes-agent#133697 ·
Los mantenedores suelen responder en 1 día
-
enhancement needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
core
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
vectorize-io/hindsight#5279 ·
Los mantenedores suelen responder en 1 día