@@ -460,13 +460,19 @@ def dict_to_mgr(
460460 keys = list (data .keys ())
461461 columns = Index (keys ) if keys else default_index (0 )
462462 arrays = [com .maybe_iterable_to_list (data [k ]) for k in keys ]
463- arrays = [arr if not isinstance (arr , Index ) else arr ._data for arr in arrays ]
464463
465464 if copy :
466465 if typ == "block" :
467466 # We only need to copy arrays that will not get consolidated, i.e.
468467 # only EA arrays
469- arrays = [x .copy () if isinstance (x , ExtensionArray ) else x for x in arrays ]
468+ arrays = [
469+ x .copy ()
470+ if isinstance (x , ExtensionArray )
471+ else x .copy (deep = True )
472+ if isinstance (x , Index )
473+ else x
474+ for x in arrays
475+ ]
470476 else :
471477 # dtype check to exclude e.g. range objects, scalars
472478 arrays = [x .copy () if hasattr (x , "dtype" ) else x for x in arrays ]
@@ -573,10 +579,10 @@ def _homogenize(
573579 refs : list [Any ] = []
574580
575581 for val in data :
576- if isinstance (val , ABCSeries ):
582+ if isinstance (val , ( ABCSeries , Index ) ):
577583 if dtype is not None :
578584 val = val .astype (dtype , copy = False )
579- if val .index is not index :
585+ if isinstance ( val , ABCSeries ) and val .index is not index :
580586 # Forces alignment. No need to copy data since we
581587 # are putting it into an ndarray later
582588 val = val .reindex (index , copy = False )
0 commit comments