Skip to content

Commit

Permalink
Add a test to make sure that collapsing ands works
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Mar 21, 2024
1 parent 5d8935e commit ab64f8a
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ def test_real_example(self):
)
assert expected == actual

def test_collapse_and(self):
actual = f(
self.inliner.get_inner_where(
parse(
"SELECT * FROM sesions WHERE event = '$pageview' AND (TRUE AND (TRUE AND TRUE AND (timestamp >= '2024-03-12' AND TRUE)))"
)
)
)
expected = f("(raw_sessions.min_timestamp + toIntervalDay(3)) >= '2024-03-12'")
assert expected == actual


class TestSessionsQueriesHogQLToClickhouse(ClickhouseTestMixin, APIBaseTest):
def print_query(self, query: str) -> str:
Expand Down

0 comments on commit ab64f8a

Please sign in to comment.