[Depr] raise_on_error kwarg with errors kwarg in astype#14878 by m-charlton · Pull Request #14967 · pandas-dev/pandas (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, there are two 'public' astype(...) methods:
NDFrame.astype(...)inpandas/core/generic.pyBlock.astype(...)inpandas/core/internals.py
In addition there is a 'protected' Block._astype(...) method inpandas/core/internals.py. Should I only put the checks in the 'public'
methods?
Bearing in mind that the raise_on_error kwarg is going to be deprecated forDataFrame.where() and replaced with the errors kwarg it would make sense to
put the code that checks the validity of the arguments in one place. Do we have
any existing code where we put such validity checking functions/methods?
I notice that both NDFrame & Block inherit from PandasObject but, I'm not
sure that this is the correct thing to do. Should I put a function inpandas/core/base.py?