Skip to content

Commit 9376605

Browse files
banortonpmhatre1
authored andcommitted
TST: adds a test to check signedness preservation after sum (pandas-dev#57306)
* add a test to check signedness preservation after sum * removed test for int8 and added issue number
1 parent 4308184 commit 9376605

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/reductions/test_reductions.py

+6
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,12 @@ def test_sum_uint64(self):
12591259
expected = np.uint64(10000000000000000000)
12601260
tm.assert_almost_equal(result, expected)
12611261

1262+
def test_signedness_preserved_after_sum(self):
1263+
# GH 37491
1264+
ser = Series([1, 2, 3, 4])
1265+
1266+
assert ser.astype("uint8").sum().dtype == "uint64"
1267+
12621268

12631269
class TestDatetime64SeriesReductions:
12641270
# Note: the name TestDatetime64SeriesReductions indicates these tests

0 commit comments

Comments
 (0)