Skip to content
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

Change the like API to behave like a predicate #1340

Merged
merged 20 commits into from
Dec 4, 2015
Merged

Change the like API to behave like a predicate #1340

merged 20 commits into from
Dec 4, 2015

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Dec 4, 2015

closes #1333

@cpcloud
Copy link
Member Author

cpcloud commented Dec 4, 2015

@llllllllll @cowlicks any comments here?

@cpcloud
Copy link
Member Author

cpcloud commented Dec 4, 2015

@llllllllll @cowlicks probably going to merge this soon

@@ -267,7 +267,9 @@ def compute_up(t, x, **kwargs):

@dispatch(Selection, np.ndarray)
def compute_up(sel, x, **kwargs):
return x[compute(sel.predicate, {sel._child: x})]
predicate = compute(sel.predicate, {sel._child: x})
cond = getattr(predicate, 'values', predicate)
Copy link
Member

Choose a reason for hiding this comment

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

Why would this become a series?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the like operation is done in the pandas backend

Copy link
Member

Choose a reason for hiding this comment

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

I am trying to find where the ndarray gets coerced into a series for the Like to dispatch properly

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I didn't realize numpy fell back to pandas. This makes much more sense, thanks

@cpcloud
Copy link
Member Author

cpcloud commented Dec 4, 2015

merging on pass

cpcloud added a commit that referenced this pull request Dec 4, 2015
Change the like API to behave like a predicate
@cpcloud cpcloud merged commit 22e61e5 into blaze:master Dec 4, 2015
@cpcloud cpcloud deleted the like-bool branch December 4, 2015 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

notlike operation on column
2 participants