Skip to content

Commit

Permalink
array
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored and Twixes committed Apr 18, 2023
1 parent 9232749 commit 0136a50
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions posthog/hogql/test/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,15 +631,17 @@ def test_resolve_union_all(self):
def test_call_type(self):
node = parse_select("select max(timestamp) from events")
resolve_types(node, self.database)
expected = ast.Call(
name="max",
# NB! timestamp was resolved to a DateTimeType for the Call's arg type.
type=ast.CallType(name="max", arg_types=[ast.DateTimeType()], return_type=ast.UnknownType()),
args=[
ast.Field(
chain=["timestamp"],
type=ast.FieldType(name="timestamp", table_type=ast.TableType(table=self.database.events)),
)
],
)
self.assertEqual(node.select[0], expected)
expected = [
ast.Call(
name="max",
# NB! timestamp was resolved to a DateTimeType for the Call's arg type.
type=ast.CallType(name="max", arg_types=[ast.DateTimeType()], return_type=ast.UnknownType()),
args=[
ast.Field(
chain=["timestamp"],
type=ast.FieldType(name="timestamp", table_type=ast.TableType(table=self.database.events)),
)
],
),
]
self.assertEqual(node.select, expected)

0 comments on commit 0136a50

Please sign in to comment.