diff --git a/pandas/tests/resample/test_base.py b/pandas/tests/resample/test_base.py index fee52780585b8..6ecbdff0018fa 100644 --- a/pandas/tests/resample/test_base.py +++ b/pandas/tests/resample/test_base.py @@ -5,6 +5,7 @@ from pandas import ( DataFrame, + Index, MultiIndex, NaT, PeriodIndex, @@ -255,7 +256,7 @@ def test_resample_count_empty_dataframe(freq, empty_frame_dti): index = _asfreq_compat(empty_frame_dti.index, freq) - expected = DataFrame({"a": []}, dtype="int64", index=index) + expected = DataFrame(dtype="int64", index=index, columns=Index(["a"], dtype=object)) tm.assert_frame_equal(result, expected) diff --git a/pandas/tests/resample/test_resample_api.py b/pandas/tests/resample/test_resample_api.py index 81a054bbbc3df..7e8779ab48b7e 100644 --- a/pandas/tests/resample/test_resample_api.py +++ b/pandas/tests/resample/test_resample_api.py @@ -197,7 +197,7 @@ def tests_raises_on_nuisance(test_frame): tm.assert_frame_equal(result, expected) expected = r[["A", "B", "C"]].mean() - msg = re.escape("agg function failed [how->mean,dtype->object]") + msg = re.escape("agg function failed [how->mean,dtype->") with pytest.raises(TypeError, match=msg): r.mean() result = r.mean(numeric_only=True) @@ -948,7 +948,7 @@ def test_frame_downsample_method(method, numeric_only, expected_data): if isinstance(expected_data, str): if method in ("var", "mean", "median", "prod"): klass = TypeError - msg = re.escape(f"agg function failed [how->{method},dtype->object]") + msg = re.escape(f"agg function failed [how->{method},dtype->") else: klass = ValueError msg = expected_data @@ -998,7 +998,7 @@ def test_series_downsample_method(method, numeric_only, expected_data): with pytest.raises(TypeError, match=msg): func(**kwargs) elif method == "prod": - msg = re.escape("agg function failed [how->prod,dtype->object]") + msg = re.escape("agg function failed [how->prod,dtype->") with pytest.raises(TypeError, match=msg): func(**kwargs) else: