Skip to content

BUG: allow single element bool queries #6163

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
Jan 29, 2014
Merged

BUG: allow single element bool queries #6163

merged 1 commit into from
Jan 29, 2014

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Jan 29, 2014

closes #6148

# only scalars or indexes
if all(isinstance(term.value, pd.Index) or term.isscalar for term in
terms):
return np.result_type(*term_values), None

# single element ndarrays
all_has_size = all(hasattr(term.value, 'size') for term in terms)
Copy link
Contributor

Choose a reason for hiding this comment

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

out of curiosity why was this squeezing in here? (IIRC you wanted to support scalar booleans, e.g. True/False)?

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC it was because I wanted to support numpy scalars...turns out not necessary to make that check to do that

Copy link
Contributor

Choose a reason for hiding this comment

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

gr8...go ahead and merge on green then

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm trying out some pathological cases to make sure that I didn't break something we didn't write tests for (if that's even a thing) :)

@cpcloud
Copy link
Member Author

cpcloud commented Jan 29, 2014

I see a tiny yellow dot 😢 what happened to the big yellow/red/green banners? I liked those.

@jreback
Copy link
Contributor

jreback commented Jan 29, 2014

where's the dot?

@cpcloud
Copy link
Member Author

cpcloud commented Jan 29, 2014

It was next to the commit hash, now it's gone ....

@ghost ghost assigned cpcloud Jan 29, 2014
@cpcloud
Copy link
Member Author

cpcloud commented Jan 29, 2014

Not totally sure how it's supposed to work.

@jreback
Copy link
Contributor

jreback commented Jan 29, 2014

I see them now...I think they just take time to show up

cpcloud added a commit that referenced this pull request Jan 29, 2014
@cpcloud cpcloud merged commit f26694c into pandas-dev:master Jan 29, 2014
@cpcloud cpcloud deleted the query-single-element-booleans-6148 branch January 29, 2014 03:54
@cpcloud
Copy link
Member Author

cpcloud commented Jan 29, 2014

Ok I'm just watching travis

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.

BUG: boolean query evaluation
2 participants