Add explicit `-> Any` return type annotation to `.pin_read` and `.pin_download`
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 55/100
Research direction
Locate the definitions of .pin_read and .pin_download, then inspect how their current return types are inferred from calls such as load_data and pd.DataFrame. Add the requested typing.Any return annotations and verify that type checking no longer requires callers to narrow inferred return types.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Python
- Stars
- 59
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rstudio/pins-python
-
.maint
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rstudio/pins-python#280 ·
-
testing
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rstudio/pins-python#196 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
rstudio/pins-python#354 ·
-
.documentation
Difficulty 3/5 1-2 days Newbie friendliness 45/100
rstudio/pins-python#348 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
rstudio/pins-python#347 ·
All issues in rstudio/pins-python
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 90/100