Skip to content

API: raise a TypeError on invalid comparison ops on Series (e.g. integer/datetime) GH4968 #4970

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 1 commit into from
Sep 24, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Sep 24, 2013

closes #4968

@cpcloud
Copy link
Member

cpcloud commented Sep 24, 2013

Just as an FYI as to why this PR is working:

  1. We have __eq__ using operator.eq which will return the result of calling an object's overridden tp_richcompare method or a bool (if the former lhs and rhs methods return NotImplemented). This is because operator.eq compares pointers if both the left-hand-side and right-hand-side methods return NotImplemented. In this case, ndarray.__eq__ is return NotImplemented for both the left and right hand side. Python then proceeds to compare object pointers.
  2. The wrapper function receives a bool from na_op. wrapper constructs the result with the left-hand-side's index which will fill the result with a single value if it's passed

@jreback
Copy link
Contributor Author

jreback commented Sep 24, 2013

@jtratner @cpcloud ok to merge then....?

@cpcloud
Copy link
Member

cpcloud commented Sep 24, 2013

hold on 1 sec want to try something

@cpcloud
Copy link
Member

cpcloud commented Sep 24, 2013

yep okay, good 2 go

jreback added a commit that referenced this pull request Sep 24, 2013
API: raise a TypeError on invalid comparison ops on Series (e.g. integer/datetime) GH4968
@jreback jreback merged commit b3cb072 into pandas-dev:master Sep 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eq and ne not consistent with other comparison operators
2 participants