googleapis / googleapis/google-cloud-python

Support extended range of pd.Timestamp with pandas 2.0

オープン
#15,661 コメント 3 件 リアクション 0 件 担当者 1 名 @ivansmf が担当を希望しています GitHub で見る
api: bigquery bigframes priority: p3 type: feature request
主要言語
Python
スター
5.4k
フォーク
1.8k
平均マージ
3日 4時間
マージ済み PR(30日)
122

説明

**Is your feature request related to a problem? Please describe.**

When querying TIMESTAMP column, with pandas > 2.0 installed, the dtype is 'datetime64[us, UTC]`.
This is using the same precision as bigquery, which is what we want.

However if I query a TIMESTAMP column that contains data that is out of bounds for a 'datetime64[ns, UTC]` (but fit in a 'datetime64[us, UTC]`), the column dtype becomes `object`.

This is inefficient and also we lose meta data here.

**Describe the solution you'd like**

If pandas > 2.0, always return `datetime64[us, UTC]` for timestamp column

**Additional context**

The same thing happens for DATE and DATETIME and should be addressed as well.

This test captures the current behavior: https://github.com/googleapis/python-bigquery-pandas/blame/72f772ec7b36ba081ed18ef4409f8262a412a1b9/tests/system/test_read_gbq.py#L538

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

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

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