Skip to content

Commit

Permalink
Adapt AttrSeries.__init__ for pandas <2.1 (Python 3.8)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Jan 26, 2024
1 parent 02d8917 commit 4d6ba01
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions genno/core/attrseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ def _constructor(self):

def __init__(self, data=None, *args, name=None, attrs=None, **kwargs):
# Emulate behaviour of Series.__init__
if isinstance(data, DataManager):
if isinstance(data, DataManager) and "fastpath" not in kwargs:
if not (
0 == len(args) == len(kwargs) and name is attrs is None
0 == len(args) == len(kwargs) and attrs is None
): # pragma: no cover
raise NotImplementedError
NDFrame.__init__(self, data)
if name:
self.name = name
return

attrs = Quantity._collect_attrs(data, attrs, kwargs)
Expand Down

0 comments on commit 4d6ba01

Please sign in to comment.