Use UTC times consistently

オープン
#285 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rstudio/pins-python のほかの issue

rstudio/pins-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。