Skip to content

Commit de502b7

Browse files
committed
COMPAT: pickle compat for Timestamp in py3.6
BUG: fix unorderable exception types in py3.6
1 parent b6ffd89 commit de502b7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

doc/source/whatsnew/v0.19.2.txt

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Bug Fixes
4444
- Compat with python 3.6 for pickling of some offsets (:issue:`14685`)
4545
- Compat with python 3.6 for some indexing exception types (:issue:`14684`)
4646
- Compat with python 3.6 for deprecation warnings in the test suite (:issue:`14681`)
47+
- Compat with python 3.6 for Timestamp pickles (:issue:``)
4748

4849

4950

pandas/tslib.pyx

+6
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,12 @@ cdef class _Timestamp(datetime):
11051105
self._assert_tzawareness_compat(other)
11061106
return _cmp_scalar(self.value, ots.value, op)
11071107

1108+
def __reduce_ex__(self, protocol):
1109+
# python 3.6 compat
1110+
# http://bugs.python.org/issue28730
1111+
# now __reduce_ex__ is defined and higher priority than __reduce__
1112+
return self.__reduce__()
1113+
11081114
def __repr__(self):
11091115
stamp = self._repr_base
11101116
zone = None

pandas/types/common.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ def _is_unorderable_exception(e):
196196
These are different error message for PY>=3<=3.5 and PY>=3.6
197197
"""
198198
if PY36:
199-
return ("'>' not supported between instances "
200-
"of 'str' and 'int'" in str(e))
199+
return "'>' not supported between instances of" in str(e)
200+
201201
elif PY3:
202202
return 'unorderable' in str(e)
203203
return False

0 commit comments

Comments
 (0)