Skip to content

Commit e2a6ea0

Browse files
committed
Adding test for variable. Changing the Python Version condition to PY36, Added Doc under section
1 parent 2f3c9ba commit e2a6ea0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

doc/source/whatsnew/v0.23.1.txt

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ Groupby/Resample/Rolling
4848
^^^^^^^^^^^^^^^^^^^^^^^^
4949

5050
- 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`)
51+
52+
Strings
53+
^^^^^^^
54+
55+
- Bug in :meth:`Series.str.replace()` where the method throws `TypeError` on Python 3.5.2
5156
-
5257

5358
Conversion

pandas/compat/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def raise_with_traceback(exc, traceback=Ellipsis):
425425

426426
# In Python 3.7, the private re._pattern_type is removed.
427427
# Python 3.5+ have typing.re.Pattern
428-
if sys.version_info >= (3, 5, 4):
428+
if PY36:
429429
import typing
430430
re_type = typing.re.Pattern
431431
else:

pandas/tests/test_compat.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
from pandas.compat import (range, zip, map, filter, lrange, lzip, lmap,
88
lfilter, builtins, iterkeys, itervalues, iteritems,
9-
next, get_range_parameters, PY2)
9+
next, get_range_parameters, PY2, re_type)
1010

1111

1212
class TestBuiltinIterators(object):
@@ -89,3 +89,8 @@ def test_get_range_parameters(self, start, stop, step):
8989
assert start_result == start_expected
9090
assert stop_result == stop_expected
9191
assert step_result == step_expected
92+
93+
94+
def test_re_type():
95+
import re
96+
assert isinstance(re.compile(''), re_type)

0 commit comments

Comments
 (0)