Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/internals/construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down