Skip to content

Commit e4c1853

Browse files
committed
add an edge case
1 parent 00f3fa5 commit e4c1853

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pandas/core/series.py

+4
Original file line numberDiff line numberDiff line change
@@ -2591,6 +2591,10 @@ def combine(self, other, func, fill_value=None):
25912591
# The function can return something of any type, so check
25922592
# if the type is compatible with the calling EA.
25932593
new_values = try_cast_to_ea(self._values, new_values)
2594+
else:
2595+
new_values = pd.Series(new_values, dtype=bool)
2596+
else:
2597+
new_values = try_cast_to_ea(self._values, new_values)
25942598

25952599
return self._constructor(new_values, index=new_index, name=new_name)
25962600

pandas/tests/arrays/test_integer.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ def test_astype_nansafe():
837837
def test_Series_large_numbers(values, dtype):
838838
# issue 30268
839839
result = pd.Series(values, dtype=dtype)
840-
ecpected = pd.Series()
840+
expected = pd.Series()
841841

842842
if isinstance(values, np.ndarray):
843843
expected = pd.Series([
@@ -857,6 +857,7 @@ def test_Series_large_numbers(values, dtype):
857857
assert result.dtype == dtype
858858
tm.assert_series_equal(result, expected, check_exact=True)
859859

860+
860861
@pytest.mark.parametrize("ufunc", [np.abs, np.sign])
861862
def test_ufuncs_single_int(ufunc):
862863
a = integer_array([1, 2, -3, np.nan])

0 commit comments

Comments
 (0)