DEPR: datetimelike.astype(int) by jbrockmendel · Pull Request #38544 · pandas-dev/pandas (original) (raw)

I ran into this case of datetime->integer casting while exploring our casting rules (#22384). @jbrockmendel do you remember the rationale for deprecating this casting? It's not really clear to me why we would in the future disallow datetimelike->integer casting.

This PR doesn't seem to give much reasoning, and the referenced issue is about the bitwidth / sign being ignored, but not sure deprecating altogether is necessarily the fix for that (the bitwidth being ignored also applies for integer->integer casting, which we didn't deprecate).