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

fix(web-analytics): Create group property filters correctly in hogql property_to_expr #19981

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add a test which failed but is fixed by this PR
robbie-c committed Jan 26, 2024

Unverified

No user is associated with the committer email.
commit eb48e5790e975750e72c65c48a306d17f2702cf0
4 changes: 4 additions & 0 deletions posthog/hogql/test/test_property.py
Original file line number Diff line number Diff line change
@@ -82,6 +82,10 @@ def test_property_to_expr_group(self):
{"type": "group", "group_type_index": 0, "key": "a", "value": "b", "operator": "is_not_set"}
),
)
self.assertEqual(
self._property_to_expr(Property(type="group", group_type_index=0, key="a", value=["b", "c"])),
self._parse_expr("group_0.properties.a = 'b' OR group_0.properties.a = 'c'"),
)

with self.assertRaises(Exception) as e:
self._property_to_expr({"type": "group", "key": "a", "value": "b"})