diff --git a/pandas/core/internals/construction.py b/pandas/core/internals/construction.py index 4dbdd5e5b77fe..005c166bb1f2a 100644 --- a/pandas/core/internals/construction.py +++ b/pandas/core/internals/construction.py @@ -567,10 +567,7 @@ def _homogenize( # Forces alignment. No need to copy data since we # are putting it into an ndarray later val = val.reindex(index, copy=False) - if isinstance(val._mgr, SingleBlockManager): - refs.append(val._mgr._block.refs) - else: - refs.append(None) + refs.append(val._references) val = val._values else: if isinstance(val, dict): diff --git a/pandas/core/series.py b/pandas/core/series.py index 06e9611c318cd..03d7b25aca49a 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -34,6 +34,7 @@ properties, reshape, ) +from pandas._libs.internals import BlockValuesRefs from pandas._libs.lib import ( is_range_indexer, no_default, @@ -734,6 +735,12 @@ def _values(self): """ return self._mgr.internal_values() + @property + def _references(self) -> BlockValuesRefs | None: + if isinstance(self._mgr, SingleArrayManager): + return None + return self._mgr._block.refs + # error: Decorated property not supported @Appender(base.IndexOpsMixin.array.__doc__) # type: ignore[misc] @property