-
Notifications
You must be signed in to change notification settings - Fork 125
ENH: Use tz-aware dtype for timestamp columns #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3e442e8
to
b0445ca
Compare
Looks like we'll have to bump the minimum version to |
I couldn't figure out how *not* to get a tz-aware dtype in 0.24.x versions, and I wanted a tz-aware dtype anyway for TIMESTAMP, so this makes it official.
b0445ca
to
e1c2df4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's ideal
DATETIME datetime64[ns] | ||
TIME datetime64[ns] | ||
DATE datetime64[ns] | ||
================== ========================= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
afe40c2
to
2a1c422
Compare
…eTZDtype as numpy dtype.
2a1c422
to
c76dbba
Compare
This is the first version that passing a dtype of pandas.api.types.DatetimeTZDtype(tz="UTC") to the Series constructor actually works. I get "TypeError: data type not understood" in lower versions.
Oof. Looks like I still get the occasional @max-sixty Thoughts on bumping the minimum version all the way to 0.24? It's a big jump from what we've had before. Otherwise, I'll see if I can make our tests robust against having naive datetime in 0.23 and before. |
4601721
to
a5a11ab
Compare
I'm going to branch this PR with just the docs changes. I'd rather not bump all the way to 0.24.0 just yet. |
Closing in favor of #269. As was pointed out to me in pandas-dev/pandas#25843 (comment) it's more "idiomatic" to call localize rather than be specific about timezones in the dtype. I'd prefer to avoid additional casts / localization if at all possible, so just documenting the current behavior for now. |
I couldn't figure out how not to get a tz-aware dtype in 0.24.x
versions, and I wanted a tz-aware dtype anyway for TIMESTAMP, so this
makes it official.
Towards #261.