Skip to content

Commit b543386

Browse files
committed
add op tests for reduction result dtype
1 parent 3e763c4 commit b543386

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/tests/arrays/test_integer.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def test_cross_type_arithmetic():
588588

589589

590590
@pytest.mark.parametrize('op', ['sum', 'min', 'max'])
591-
def test_preserve_groupby_dtypes(op):
591+
def test_preserve_dtypes(op):
592592
# TODO(#22346): preserve Int64 dtype
593593
# for ops that enable (mean would actually work here
594594
# but generally it is a float return value)
@@ -598,6 +598,11 @@ def test_preserve_groupby_dtypes(op):
598598
"C": integer_array([1, None, 3], dtype='Int64'),
599599
})
600600

601+
# op
602+
result = getattr(df.C, op)()
603+
assert isinstance(result, int)
604+
605+
# groupby
601606
result = getattr(df.groupby("A"), op)()
602607
expected = pd.DataFrame({
603608
"B": np.array([1.0, 3.0]),

0 commit comments

Comments
 (0)