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 85a878c commit 3b00da1
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 3b00da1

Please sign in to comment.