Skip to content

Commit

Permalink
Backport PR pandas-dev#57889 on branch 2.2.x (BUG: Handle Series cons…
Browse files Browse the repository at this point in the history
…truction with Dask, dict-like, Series) (pandas-dev#57899)

Backport PR pandas-dev#57889: BUG: Handle Series construction with Dask, dict-like, Series

Co-authored-by: Matthew Roeschke <[email protected]>
  • Loading branch information
meeseeksmachine and mroeschke authored Mar 18, 2024
1 parent 71a6797 commit cc56321
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def __init__(
data = data.reindex(index, copy=copy)
copy = False
data = data._mgr
elif is_dict_like(data):
elif isinstance(data, Mapping):
data, index = self._init_dict(data, index, dtype)
dtype = None
copy = False
Expand Down Expand Up @@ -605,7 +605,7 @@ def __init__(
)

def _init_dict(
self, data, index: Index | None = None, dtype: DtypeObj | None = None
self, data: Mapping, index: Index | None = None, dtype: DtypeObj | None = None
):
"""
Derive the "_mgr" and "index" attributes of a new Series from a
Expand Down

0 comments on commit cc56321

Please sign in to comment.