@jorisvandenbossche I expected this to return pd.NA. Is this intentional?
Comment From: jorisvandenbossche
The same is true for any datetime-like scalar, not just NaT:
In [9]: pd.NA == pd.Timestamp("2012")
Out[9]: False
I don't think this is intentional, but somewhat "knowingly ignored for now", at least going from this comment: https://github.com/pandas-dev/pandas/pull/30245#discussion_r359327043 (although that specific comment was about ufuncs, but for scalar operations it's the same logic).
Right now, we only handle a few specific scalar types (and for other scalars, it defers by returning NotImplemented
):
https://github.com/pandas-dev/pandas/blob/44e3c40c312761cd832c93c2715d1ebf7a7581f6/pandas/_libs/missing.pyx#L287-L299
So either we need to handle more scalar types here, or our scalar types need to handle NA.
Comment From: jbrockmendel
i think the relevant Timestamp/NaT methods have been updated so they will return NotImplemented when operating against pd.NA, so it would now be easy to change the behavior if desired