Skip to content

Commit efedd5f

Browse files
author
OlivierLuG
committed
TST pandas-dev#28980 Certain comparison operations misbehaving for period dtype
1 parent 65d9fe4 commit efedd5f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/series/test_period.py

+10
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,13 @@ def test_to_period(self, input_vals):
113113
expected = Series([input_vals], dtype="Period[D]")
114114
result = Series([input_vals], dtype="datetime64[ns]").dt.to_period("D")
115115
tm.assert_series_equal(result, expected)
116+
117+
@pytest.mark.parametrize("comparison_data", ["a", False, 1, 1.0, None])
118+
def test_comparison_operations(self, comparison_data):
119+
# GH 28980
120+
expected = Series([False, False])
121+
result = (
122+
Series([pd.Period("2019"), pd.Period("2020")], dtype="period[A-DEC]")
123+
== comparison_data
124+
)
125+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)