diff --git a/pandas/core/internals/construction.py b/pandas/core/internals/construction.py index 61d38c43aca24..c55305e2d69b9 100644 --- a/pandas/core/internals/construction.py +++ b/pandas/core/internals/construction.py @@ -295,7 +295,7 @@ def ndarray_to_mgr( copy_on_sanitize = False if typ == "array" else copy vdtype = getattr(values, "dtype", None) - if is_1d_only_ea_dtype(vdtype) or isinstance(dtype, ExtensionDtype): + if is_1d_only_ea_dtype(vdtype) or is_1d_only_ea_dtype(dtype): # GH#19157 if isinstance(values, (np.ndarray, ExtensionArray)) and values.ndim > 1: diff --git a/pandas/tests/frame/test_constructors.py b/pandas/tests/frame/test_constructors.py index f070cf3dd20f4..e7c2e17bc9ac1 100644 --- a/pandas/tests/frame/test_constructors.py +++ b/pandas/tests/frame/test_constructors.py @@ -70,13 +70,16 @@ class TestDataFrameConstructors: - def test_constructor_from_2d_datetimearray(self): + def test_constructor_from_2d_datetimearray(self, using_array_manager): dti = date_range("2016-01-01", periods=6, tz="US/Pacific") dta = dti._data.reshape(3, 2) df = DataFrame(dta) expected = DataFrame({0: dta[:, 0], 1: dta[:, 1]}) tm.assert_frame_equal(df, expected) + if not using_array_manager: + # GH#44724 big performance hit if we de-consolidate + assert len(df._mgr.blocks) == 1 def test_constructor_dict_with_tzaware_scalar(self): # GH#42505