Use UTC times consistently

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
backend

调研方向

先阅读 pins/versions.py 中第 77-78 行附近和第 104 行的内容,然后将其 datetime 处理方式与链接的 pins-r 实现进行比较。检查 Python pins 在哪里写入和解析创建时间戳,并记录由此产生的 UTC 行为;完成时应一致地覆盖相关路径,并处理建议的 Ruff DTZ 规则。

由索引模型根据 Issue 内容生成。

描述

.new-behavior

Regarding this comment:
https://github.com/rstudio/pins-python/blob/d215a8cd6cf958be0f4fc41c6e90e21c907b4655/pins/versions.py#L77-L78

As far as I can tell, R pins will write the created datetime as a UTC time:

https://github.com/rstudio/pins-r/blob/de47c3141d97020e9f4a6a2e93d5823bc649105b/R/meta.R#L50

And the functions it uses to parse datetimes also specify UTC (although the two parse_ functions indeed strip it out).
https://github.com/rstudio/pins-r/blob/de47c3141d97020e9f4a6a2e93d5823bc649105b/R/meta.R#L55-L68

I haven't looked into this too deeply though.

As far as I can tell, Python pins will just use the local datetime, e.g.
https://github.com/rstudio/pins-python/blob/d215a8cd6cf958be0f4fc41c6e90e21c907b4655/pins/versions.py#L104

I suggest that this behaviour is changed (this is arguably a breaking change, arguably a bugfix) to use UTC consistently everywhere. To that end, the DTZ rules in ruff could be helpful to enable.

In any case, I think it would be worth documenting this behaviour in more detail.

主要语言
Python
星标
59
派生
11
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

rstudio/pins-python 的其他 Issue

查看 rstudio/pins-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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