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

BUG: fix len for interactive exprs that wrap sql #1273

Merged
merged 1 commit into from
Oct 13, 2015

Conversation

llllllllll
Copy link
Member

compute for the sqlbackend would return a select. the len machinery would then try to coerce this into an int and fail with a type error.


def test_interactive_len(sql):
t = Data(sql)
assert len(t) == odo(t.count(), int)
Copy link
Member

Choose a reason for hiding this comment

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

You can actually just call int(t.count()), but up to you

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, I didn't realize __int__ was the same. I like the clarity of odo here; however, I don't mind promoting this pattern.

@cpcloud
Copy link
Member

cpcloud commented Oct 13, 2015

@llllllllll Merge when ready

@llllllllll
Copy link
Member Author

I only needed to resolve the whatsnew but I rebased so I will let this pass before merging.

@cpcloud
Copy link
Member

cpcloud commented Oct 13, 2015

cool

cpcloud added a commit that referenced this pull request Oct 13, 2015
BUG: fix len for interactive exprs that wrap sql
@cpcloud cpcloud merged commit 88a9c3b into blaze:master Oct 13, 2015
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.

None yet

2 participants