Open MarcAntoineSchmidtQC opened 6 days ago
@lbittarello, if you have time I would love to get your feedback. It removes the _Categorical
class that you added during the polars PR.
If we deprecate the cat
property, I don't think we should be thinking about expanding its scope. Polars support is not released yet, so in the stable version cat
is a pandas.Categorical
. I would be happy to simply return a pandas.Categorical
when possible and otherwise raise an error saying that this method is not supported with a non-pandas backend. This is fully backward compatible.
Of course, I can add a more obvious error message instead of relying on python spitting out an error because it doesn't know what pd
is.
Would adding an _input_dtype
argument to CategoricalMatrix
's constructor solve this? __getitem__
sees self and can pass this property to the newly created matrix.
I would be happy to simply return a
pandas.Categorical
when possible and otherwise raise an error saying that this method is not supported with a non-pandas backend.
That's fine by me. :)
See this issue on Glum to understand the reasoning.
Checklist
CHANGELOG.rst
entry