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 equality #1600

Closed
wants to merge 7 commits into from
Closed

BUG: Fix equality #1600

wants to merge 7 commits into from

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Aug 16, 2018

Closes #1599

This is a temporary fix that preserves most existing behavior until we can
refactor the compiler to separate compilation from optimization.

@cpcloud cpcloud added bug Incorrect behavior inside of ibis complexity-high labels Aug 16, 2018
@cpcloud cpcloud modified the milestones: 0.14, 0.15 Aug 16, 2018
@cpcloud cpcloud changed the title WIP/BUG: Fix equality BUG: Fix equality Sep 5, 2018
@cpcloud
Copy link
Member Author

cpcloud commented Sep 5, 2018

@kszucs can you review this PR when you get a chance?

if self.equals(other):
return True

fn = lambda e: (lin.proceed, e.op()) # noqa: E731
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps It'd be useful to factor out this block to a lin.flatten function. I start to like even more this lin.traverse :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool, can you open an issue for that?

Copy link
Member

Choose a reason for hiding this comment

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

Done #1612

),
t2 AS (
)
SELECT t2.*
Copy link
Member

Choose a reason for hiding this comment

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

Reviewing SQL string is surprisingly hard, but it looks way better.

FROM t0
WHERE t0.`o_totalprice` > (
SELECT avg(t7.`o_totalprice`) AS `mean`
FROM t0 t7
Copy link
Member

Choose a reason for hiding this comment

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

At first it looks odd. If I'm correct t0 is tpch and t7 is tpch.view(), so it's actually correct.

Copy link
Member

@kszucs kszucs left a comment

Choose a reason for hiding this comment

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

It looks good!

@kszucs
Copy link
Member

kszucs commented Sep 5, 2018

@cpcloud Should I merge?

if hasattr(left, 'equals'):
return left.equals(right, cache=cache)
return left == right
return (hasattr(left, 'equals') and
Copy link
Member

Choose a reason for hiding this comment

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

IMO the previous was more readable.

@kszucs
Copy link
Member

kszucs commented Sep 5, 2018

The tests broke.

@cpcloud
Copy link
Member Author

cpcloud commented Sep 6, 2018

Yeah, using and was incorrect because left == right would be executed regardless. Fixed

@cpcloud
Copy link
Member Author

cpcloud commented Sep 6, 2018

Merging on green.

@kszucs
Copy link
Member

kszucs commented Sep 6, 2018

@cpcloud I've recently updated the clickhouse-*-feedstocks to support python 3.7 and one of the builds was broken. Theoretically it's enough to restart the build, however I cannot do that can You give me permissions (just seen it's your circleci)?

@cpcloud
Copy link
Member Author

cpcloud commented Sep 6, 2018

@kszucs Is this why the python35_test job failed? I can restart once the other builds finish

@kszucs
Copy link
Member

kszucs commented Sep 6, 2018

Ok, it's still failing. I need to leave the openoffice now, I'll be in front of keyboard again in 30m..

@kszucs
Copy link
Member

kszucs commented Sep 6, 2018

Re. I'm reproducing it locally, now that I have bandwith.

@kszucs
Copy link
Member

kszucs commented Sep 6, 2018

@cpcloud Please restart your builds, should(!!!) work now!

@cpcloud
Copy link
Member Author

cpcloud commented Sep 6, 2018

@kszucs Excellent, thanks for digging in.

@cpcloud cpcloud closed this in 591c058 Sep 6, 2018
@cpcloud cpcloud deleted the fix-equality branch September 6, 2018 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Expression equality is broken and was never correct
2 participants