Skip to content

TST: Test for the Enum triggering TypeError (#22551 issue) #47715

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

Merged
merged 20 commits into from
Jul 16, 2022
Merged
13 changes: 13 additions & 0 deletions pandas/tests/frame/test_arithmetic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import deque
from datetime import datetime
from enum import Enum
import functools
import operator
import re
Expand Down Expand Up @@ -2050,3 +2051,15 @@ def _constructor_sliced(self):

result = sdf + sdf
tm.assert_frame_equal(result, expected)


def test_enum_column_equality():
Cols = Enum("Cols", "col1 col2")

q1 = DataFrame({Cols.col1: [1, 2, 3]})
q2 = DataFrame({Cols.col1: [1, 2, 3]})

result = q1[Cols.col1] == q2[Cols.col1]
expected = Series([True, True, True], name=Cols.col1)

tm.assert_series_equal(result, expected)