Skip to content

Assert expression equality #8446

Answered by cpcloud
saschahofmann asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for opening a discussion.

In general I would recommend against depending on the specifics of the generated SQL if possible.

Details like quoting, or the specific functions used to implement a feature may change across minor releases.

Expressions have a public equals method that allows you to do the kind of comparison you're talking about:

In [9]: from ibis.interactive import *

In [10]: t = ex.penguins.fetch()

In [11]: t.order_by("island").equals(t.order_by("island"))
Out[11]: True

In [12]: t.island.equals(t.island)
Out[12]: True

In [13]: t.island.equals(t.bill_depth_mm)
Out[13]: False

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@saschahofmann
Comment options

Answer selected by saschahofmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants