Closed
Description
Revisiting some 6 month old class that subclasses Series
and overrides __finalize__
as:
def __finalize__(self, other, method=None, **kwargs):
pd.Series.__finalize__(self, other, method=method, **kwargs)
self.metadata = other.metadata.copy()
self.metadata.parent = self
return self
With 0.21.1 these objects can no longer be rendered:
>>> ser
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pandas/core/base.py", line 80, in __repr__
return str(self)
File "pandas/core/base.py", line 60, in __str__
return self.__bytes__()
File "pandas/core/base.py", line 72, in __bytes__
return self.__unicode__().encode(encoding, 'replace')
File "pandas/core/series.py", line 1066, in __unicode__
max_rows=max_rows, length=show_dimensions)
File "pandas/core/series.py", line 1109, in to_string
max_rows=max_rows)
File "pandas/io/formats/format.py", line 176, in __init__
self._chk_truncate()
File "pandas/io/formats/format.py", line 190, in _chk_truncate
series.iloc[-row_num:]))
File "pandas/core/reshape/concat.py", line 213, in concat
return op.get_result()
File "pandas/core/reshape/concat.py", line 377, in get_result
return cons(mgr, name=name).__finalize__(self, method='concat')
File "pdsm/core/series.py", line 125, in __finalize__
self.metadata = other.metadata.copy()
AttributeError: '_Concatenator' object has no attribute 'metadata'
I had assumed that other
would always be of the same class as self
. Is _Concatenator
a recent addition?