Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Nov 23, 2023
1 parent 363d8bf commit d151196
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions posthog/hogql/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def create_hogql_database(team_id: int, modifiers: Optional[HogQLQueryModifiers]
name="person_id",
expr=parse_expr("ifNull(override.override_person_id, event_person_id)", start=None),
)
database.events.fields["poe"].fields["id"] = database.events.fields["person_id"]
database.events.fields["person"] = FieldTraverser(chain=["poe"])

for mapping in GroupTypeMapping.objects.filter(team=team):
Expand Down
1 change: 0 additions & 1 deletion posthog/hogql/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ def visit_field(self, node: ast.Field):
node.type = loop_type

if isinstance(node.type, ast.ExpressionFieldType):
# TODO: make sure new_expr is of type node.type.return_type
new_expr = clone_expr(node.type.expr)
new_node = ast.Alias(alias=node.type.name, expr=new_expr, hidden=True)
new_node = self.visit(new_node)
Expand Down
2 changes: 1 addition & 1 deletion posthog/hogql/test/test_modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_modifiers_persons_on_events_mode_mapping(self):
(
PersonsOnEventsMode.v2_enabled,
"events.event",
"events.person_id",
"ifNull(events__override.override_person_id, events.person_id) AS id",
"events.person_properties",
"toTimeZone(events.person_created_at, %(hogql_val_0)s) AS created_at",
),
Expand Down

0 comments on commit d151196

Please sign in to comment.