Skip to content

Commit e3698dd

Browse files
authored
TST: Test for the Enum triggering TypeError (#22551 issue) (#47715)
* TST * TST * TST * updated strign formatting * updated formatting * updating the test place within files * removing an additional parentheses * removing the buggy file that was pushed * removing the buggy file that was pushed * fixing initial file * fixing order of import * fixing space * fixing space * fixing space * series * series * series * series * syntax
1 parent cb5a924 commit e3698dd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/frame/test_arithmetic.py

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from collections import deque
22
from datetime import datetime
3+
from enum import Enum
34
import functools
45
import operator
56
import re
@@ -2050,3 +2051,15 @@ def _constructor_sliced(self):
20502051

20512052
result = sdf + sdf
20522053
tm.assert_frame_equal(result, expected)
2054+
2055+
2056+
def test_enum_column_equality():
2057+
Cols = Enum("Cols", "col1 col2")
2058+
2059+
q1 = DataFrame({Cols.col1: [1, 2, 3]})
2060+
q2 = DataFrame({Cols.col1: [1, 2, 3]})
2061+
2062+
result = q1[Cols.col1] == q2[Cols.col1]
2063+
expected = Series([True, True, True], name=Cols.col1)
2064+
2065+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)