BUG: SparseDtype requires numpy dtype by jbrockmendel · Pull Request #53160 · pandas-dev/pandas (original) (raw)
Seems like a user was relying on passing a sparse categorical type, does it mean it needs deprecating? #49987
They were, but then it would silently give them an unwanted cast to Sparse[object]
df = pd.DataFrame([["a", 0],["b", 1], ["b", 2]], columns=["A","B"])
>>> df["A"].astype(SparseDtype("category"))
Sparse[object, nan]