Skip to content

COMPAT: pickle compat for Timestamp in py3.6 #14689

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/source/whatsnew/v0.19.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ Bug Fixes


- Compat with python 3.6 for pickling of some offsets (:issue:`14685`)
- Compat with python 3.6 for some indexing exception types (:issue:`14684`)
- Compat with python 3.6 for some indexing exception types (:issue:`14684`, :issue:`14689`)
- Compat with python 3.6 for deprecation warnings in the test suite (:issue:`14681`)
- Compat with python 3.6 for Timestamp pickles (:issue:`14689`)



Expand Down
6 changes: 6 additions & 0 deletions pandas/tslib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,12 @@ cdef class _Timestamp(datetime):
self._assert_tzawareness_compat(other)
return _cmp_scalar(self.value, ots.value, op)

def __reduce_ex__(self, protocol):
# python 3.6 compat
# http://bugs.python.org/issue28730
# now __reduce_ex__ is defined and higher priority than __reduce__
return self.__reduce__()

def __repr__(self):
stamp = self._repr_base
zone = None
Expand Down
4 changes: 2 additions & 2 deletions pandas/types/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ def _is_unorderable_exception(e):
These are different error message for PY>=3<=3.5 and PY>=3.6
"""
if PY36:
return ("'>' not supported between instances "
"of 'str' and 'int'" in str(e))
return "'>' not supported between instances of" in str(e)

elif PY3:
return 'unorderable' in str(e)
return False
Expand Down