Description
Originally posted by @weiji14 in #3621 (comment)
Opening a discussion on whether to:
- Follow GMT (allow users to plot data at a non-UTC timezone, by ignoring the timezone offset) [breaking change]
- Follow NumPy, whereby the data will from any non-UTC timezone will be converted to UTC always [current behaviour]
If going with 2, we should at least raise a warning if a non-UTC timezone is used, that a conversion is taking place. If going with 1, we would need to special-case datetime types, that might mean extra logic in the
_to_numpy
function, or having to keeparray_to_datetime
(so don't merge #3507 yet).
class/type | has timezone support | Link |
---|---|---|
Python datetime |
✅ | https://docs.python.org/3/library/datetime.html#datetime.datetime.tzinfo |
pandas.Timestamp | ✅ | https://pandas.pydata.org/pandas-docs/version/2.2/reference/api/pandas.Timestamp.html |
pyarrow.timestamp (type) | ✅ | https://arrow.apache.org/docs/17.0/python/generated/pyarrow.timestamp.html |
numpy.datetime64 | ❌ | https://numpy.org/doc/2.1/reference/arrays.scalars.html#numpy.datetime64 |
Context is that we need to decide on whether users would expect that datetime arrays/types (e.g. Python datetime.datetime
, pandas.Series
with pandas.Timestamp
, pyarrow.timestamp
, etc) that have non-UTC timezones should be plotted in the same non-UTC timezone, or have an automated conversion to a UTC timezone before plotting.
Vote 🚀 for option 1, and 👀 for option 2. Do comment down below to explain.