Skip to content
This repository was archived by the owner on Dec 22, 2019. It is now read-only.

Commit 687d950

Browse files
author
araraonline
committed
lint
1 parent d7bae97 commit 687d950

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

pandas/tests/reshape/test_append.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,6 @@
3838
pd.MultiIndex.from_arrays(['A B C'.split(), 'D E F'.split()]),
3939
]
4040

41-
index_sort_groups = [
42-
# When indexes from the same group are joined, the result is sortable.
43-
# When indexes from different groups are joined, the result is not
44-
# sortable.
45-
46-
[ # joining produces a string index
47-
pd.Index(['A', 'B', 'C']),
48-
pd.CategoricalIndex('A B C'.split()),
49-
pd.CategoricalIndex('D E F'.split(), ordered=True)],
50-
51-
[ # numeric indexes
52-
pd.RangeIndex(3),
53-
pd.Int64Index([3, 4, 5]),
54-
pd.UInt64Index([6, 7, 8]),
55-
pd.Float64Index([3.5, 4.5, 5.5]),
56-
pd.Index([9, 10, 11], dtype=object)],
57-
58-
[pd.to_datetime(['2013-01-01', '2013-01-10', '2013-01-15'])],
59-
[pd.to_timedelta(['1 day', '2 days', '3 days'])],
60-
[pd.PeriodIndex(start='2000', periods=3)],
61-
[pd.interval_range(start=0, end=3)],
62-
[pd.MultiIndex.from_arrays(['A B C'.split(), 'D E F'.split()])],
63-
]
6441

6542
indexes_with_dups = [
6643
# base
@@ -92,6 +69,31 @@
9269
]
9370

9471

72+
index_sort_groups = [
73+
# When indexes from the same group are joined, the result is sortable.
74+
# When indexes from different groups are joined, the result is not
75+
# sortable.
76+
77+
[ # joining produces a string index
78+
pd.Index(['A', 'B', 'C']),
79+
pd.CategoricalIndex('A B C'.split()),
80+
pd.CategoricalIndex('D E F'.split(), ordered=True)],
81+
82+
[ # numeric indexes
83+
pd.RangeIndex(3),
84+
pd.Int64Index([3, 4, 5]),
85+
pd.UInt64Index([6, 7, 8]),
86+
pd.Float64Index([3.5, 4.5, 5.5]),
87+
pd.Index([9, 10, 11], dtype=object)],
88+
89+
[pd.to_datetime(['2013-01-01', '2013-01-10', '2013-01-15'])],
90+
[pd.to_timedelta(['1 day', '2 days', '3 days'])],
91+
[pd.PeriodIndex(start='2000', periods=3)],
92+
[pd.interval_range(start=0, end=3)],
93+
[pd.MultiIndex.from_arrays(['A B C'.split(), 'D E F'.split()])],
94+
]
95+
96+
9597
def cls_name(obj):
9698
return obj.__class__.__name__
9799

@@ -275,7 +277,7 @@ def test_bad_input_type(self, sort):
275277

276278
def test_no_unecessary_upcast(self, sort):
277279
# GH: 22621
278-
# When appending, the resulting columns should
280+
# When appending, the result columns should
279281
# not be float64 without necessity.
280282

281283
# basic
@@ -499,8 +501,7 @@ def test_duplicates_with_sort(self, col_index):
499501
df1 = pd.DataFrame([[1, 2, 3]], columns=col_index)
500502
df2 = pd.DataFrame([[4, 5, 6]], columns=col_index.copy())
501503
ctx = pytest.raises(InvalidIndexError,
502-
match=r'When sort=True, indexes with duplicate'
503-
' values are not allowed.')
504+
match=r'When sort=True, indexes with dupl.*')
504505

505506
with ctx:
506507
result = df1.append([], sort=True)

0 commit comments

Comments
 (0)