Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding test for variable. Changing the Python Version condition to PY…
…36, Added Doc under section
  • Loading branch information
adamabk committed May 17, 2018
commit e2a6ea04745069971d214ee44f4b584e6fd4265b
5 changes: 5 additions & 0 deletions doc/source/whatsnew/v0.23.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ Groupby/Resample/Rolling
^^^^^^^^^^^^^^^^^^^^^^^^

- Bug in :func:`DataFrame.agg` where applying multiple aggregation functions to a :class:`DataFrame` with duplicated column names would cause a stack overflow (:issue:`21063`)

Strings
^^^^^^^

- Bug in :meth:`Series.str.replace()` where the method throws `TypeError` on Python 3.5.2
-

Conversion
Expand Down
2 changes: 1 addition & 1 deletion pandas/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def raise_with_traceback(exc, traceback=Ellipsis):

# In Python 3.7, the private re._pattern_type is removed.
# Python 3.5+ have typing.re.Pattern
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we just make this >= PY36 and call it a day?

if sys.version_info >= (3, 5, 4):
if PY36:
import typing
re_type = typing.re.Pattern
else:
Expand Down
7 changes: 6 additions & 1 deletion pandas/tests/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
from pandas.compat import (range, zip, map, filter, lrange, lzip, lmap,
lfilter, builtins, iterkeys, itervalues, iteritems,
next, get_range_parameters, PY2)
next, get_range_parameters, PY2, re_type)


class TestBuiltinIterators(object):
Expand Down Expand Up @@ -89,3 +89,8 @@ def test_get_range_parameters(self, start, stop, step):
assert start_result == start_expected
assert stop_result == stop_expected
assert step_result == step_expected


def test_re_type():
import re
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u move the import to the top

assert isinstance(re.compile(''), re_type)