You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tarantool supports datetime type since version 2.10.0 [1]. This patch
introduced the support of Tarantool datetime type in msgpack decoders
and encoders.
The Tarantool datetime type is mapped to new tarantool.Datetime type
which inherits pandas.Timestamp [2]. pandas.Timestamp was chosen as a
base class because it could be used to store both nanoseconds and
timezone information. In-build Python datetime.datetime supports
microseconds at most, numpy.datetime64 do not support timezones. There
are two reasons to use custom type instead of plain pandas.Timestamp:
- tzindex may be lost on conversion to pandas.Timestamp
- Tarantool datetime interval type is planned to be stored in custom
type tarantool.Interval and we'll need a way to support arithmetic
between datetime and interval.
msgpack encoder supports encoding pandas.Timestamp with
tarantool.Datetime tools, but it always decodes to tarantool.Datetime.
If you plan to work with tarantool datetimes, please stick to the
tarantool.Datetime object rather than pure pandas.Timestamp. You can
create tarantool.Datetime from pandas.Timestamp or by using the same
API as in plain pandas.Timestamp. If you used numpy.datetime64 or
datetime.datetime in your logic, you can use pandas.to_datetime64() and
pandas.to_datetime() converters.
This patch does not yet introduce the support of timezones in datetime.
1. tarantool/tarantool#5941
2. https://pandas.pydata.org/docs/reference/api/pandas.Timestamp.html
Part of #204
0 commit comments