Subclassed attributes are not serializable #10553
Labels
Bug
Compat
pandas objects compatability with Numpy or Python functions
Subclassing
Subclassing pandas objects
Milestone
In a subclass of pandas objects, pickling an object doesn't serialize properties of an instance of that subclass, even if the attribute has been added to
_metadata
. It would be hard to override this behavior entirely in the subclass, because it will require updates to__getstate__
and__setstate__
, and probably also an addition or subclass ofBlockManager
. It would be nice if the_metadata
serialization was handled in the base pandas class.Example:
raises
AttributeError: 'SubDataFrame' object has no attribute 'my_data'
(edited original example for correctness)
The text was updated successfully, but these errors were encountered: