Skip to content

Commit c386159

Browse files
fixed a few broken tests
1 parent 0f8a053 commit c386159

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pandas/core/apply.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ def apply_series_generator(self) -> ResType:
349349
return results
350350

351351
def wrap_results(self, results: ResType) -> Union["Series", "DataFrame"]:
352+
from pandas import Series
352353

353354
# see if we can infer the results
354355
if len(results) > 0 and 0 in results and is_sequence(results[0]):
@@ -360,7 +361,7 @@ def wrap_results(self, results: ResType) -> Union["Series", "DataFrame"]:
360361
constructor_sliced = self.obj._constructor_sliced
361362
is_empty = isinstance(results, (list, tuple, dict)) and not results
362363
if constructor_sliced is Series and is_empty:
363-
result = constructor_sliced(results, dtype=object)
364+
result = constructor_sliced(results, dtype=np.float64)
364365
else:
365366
result = constructor_sliced(results)
366367
result.index = self.res_index

pandas/tests/frame/test_analytics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ def test_mean_mixed_datetime_numeric(self, tz):
10671067
tm.assert_series_equal(result, expected)
10681068

10691069
@pytest.mark.parametrize("tz", [None, "UTC"])
1070-
def test_mean_excludeds_datetimes(self, tz):
1070+
def test_mean_excludes_datetimes(self, tz):
10711071
# https://github.com/pandas-dev/pandas/issues/24752
10721072
# Our long-term desired behavior is unclear, but the behavior in
10731073
# 0.24.0rc1 was buggy.

0 commit comments

Comments
 (0)