Add explicit `-> Any` return type annotation to `.pin_read` and `.pin_download`
还没有人认领这个 Issue。
评估
调研方向
定位 .pin_read 和 .pin_download 的定义,然后检查如何根据 load_data 和 pd.DataFrame 等调用推断出它们当前的返回类型。添加所请求的 typing.Any 返回注解,并验证类型检查不再要求调用方缩小推断出的返回类型。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Python
- 星标
- 59
- 派生
- 11
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rstudio/pins-python 的其他 Issue
-
.maint
难度 2/5 1-3 小时 新手友好度 62/100
rstudio/pins-python#280 ·
-
testing
难度 2/5 1-3 小时 新手友好度 62/100
rstudio/pins-python#196 ·
-
难度 2/5 1-3 小时 新手友好度 55/100
rstudio/pins-python#354 ·
-
.documentation
难度 3/5 1-2 天 新手友好度 45/100
rstudio/pins-python#348 ·
-
难度 2/5 1-3 小时 新手友好度 48/100
rstudio/pins-python#347 ·
查看 rstudio/pins-python 的全部 Issue
相似的 Issue
-
area: harness bug status: needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
Human-Agent-Society/reef#625 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 80/100
learningequality/kolibri#15351 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Name consistency 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eellak/triplestore#65 · 1 条评论 ·