I am trying to write a class that inherits pandas' DataFrame
class for some custom data that I am working on.
class EquityDataFrame(DataFrame):
def __init__(self, *args, **kwargs):
DataFrame.__init__(self, *args, **kwargs)
def myfunc1(self,...)
... # does something
def myfunc2(self, ...)
... # does something
In PyCharm, I get the following warning for the name of the class EquityDataFrame
:
Class EquityDataFrame must implement all abstract methods
This inspection detects when there aren't all abstract properties/methods defined in the subclass
I tried googling, but I couldn't find a useful description of this warning. Can someone help me what this warning means?
After looking for 6 years, pylint gave me the answer :[W0223(abstract-method), CustomDataFrame] Method '_constructor_expanddim' is abstract in class 'DataFrame' but is not overridden
And indeed implementing
@property
def _constructor_expanddim(self) -> Type["CustomDataFrame"]:
raise NotImplementedError("Not supported for CustomDataFrames!")
made the warning disappear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With