Skip to content

Commit 606bd08

Browse files
internal: change datetime implementation
Rework our implementation of tarantool.Datetime class. Previously it had relied on pandas.Timestamp and pandas.Timedelta. There were user complaints about pandas as a requirement since it's rather heavy. Now our implementation of datetime uses built-in datetime.datetime, datetime.timedelta and other built-in tools. It is expected that the implementation change wouldn't affect users, but some minor behavior traits were broken in this patch: - Now we rely on datetime argument validation which if differs from pandas one. For example, it doesn't allow overflows for fields. Exceptions that user may receive from internal datetime are, of course, had changed as well. - We drop the support of `__eq__` for pandas.Timestamp. We simply compared underlying pandas.Timestamp with argument one, and now it's impossible. If the feature would be required later, we may implement its comparison in some compatible way. - __repr__ has been changed since internal representation has been changed as well. Closes #290
1 parent 4bdbdda commit 606bd08

File tree

6 files changed

+297
-88
lines changed

6 files changed

+297
-88
lines changed

Diff for: CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- Migrate to built-in `Warning` instead of a custom one.
1212
- Migrate to built-in `RecursionError` instead of a custom one.
1313
- Collect full exception traceback.
14+
- Rework `tarantool.Datetime` implementation to use built-in
15+
`datetime.datetime`. External changes are as follows. Some of them
16+
are **breaking**.
17+
- Package no longer depends on `pandas` (#290).
18+
- `__repr__` has been changed.
19+
- Input arguments are validated with `datetime.datetime` rules.
20+
- Class is no longer expected to throw `pandas.Timestamp`
21+
exceptions. `datetime.datetime` exceptions will
22+
be thrown instead of them.
23+
- Drop the support of `__eq__` operator for `pandas.Timestamp`.
1424

1525
## 0.12.1 - 2023-02-28
1626

Diff for: docs/source/conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@
344344
intersphinx_mapping = {
345345
'python': ('http://docs.python.org/', None),
346346
'msgpack': ('https://msgpack-python.readthedocs.io/en/latest/', None),
347-
'pandas': ('https://pandas.pydata.org/docs/', None),
348347
'pytz': ('https://pytz.sourceforge.net/', None),
349348
}
350349

Diff for: requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
msgpack
2-
pandas
32
pytz
43
dataclasses; python_version <= '3.6'

Diff for: rpm/SPECS/python-tarantool.spec

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Python client library for Tarantool.}
2929
%package -n python3-%{srcname}
3030

3131
Requires: python3-msgpack
32-
Requires: python3-pandas
3332
Requires: python3-pytz
3433

3534
Summary: %{summary}

0 commit comments

Comments
 (0)