Skip to content

BUG: NaT.__cmp__(invalid) should raise TypeError #35585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 6, 2020

Conversation

jbrockmendel
Copy link
Member

assert NaT != other
assert other != NaT

for op in [operator.le, operator.lt, operator.ge, operator.gt]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you parametrize these instead of looping? Makes future debugging easier

@WillAyd WillAyd added the Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate label Aug 6, 2020
@jreback jreback added the Error Reporting Incorrect or improved errors from pandas label Aug 6, 2020
@jreback jreback added this to the 1.2 milestone Aug 6, 2020
@jreback jreback merged commit d82e540 into pandas-dev:master Aug 6, 2020
@jreback
Copy link
Contributor

jreback commented Aug 6, 2020

thanks @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG/API Should pd.NaT < "foo" raise?
3 participants