Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#352 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
55/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
api

调研方向

定位 .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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rstudio/pins-python 的其他 Issue

查看 rstudio/pins-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。