Skip to content

Commit

Permalink
fix last c++
Browse files Browse the repository at this point in the history
  • Loading branch information
aspicer committed Oct 24, 2024
1 parent 75129b2 commit 3743e83
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hogql_parser/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

setup(
name="hogql_parser",
version="1.0.451",
version="1.0.452",
url="https://github.com/PostHog/posthog/tree/master/hogql_parser",
author="PostHog Inc.",
author_email="[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion posthog/hogql/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def visit(self, node: AST | None):

return response

def visit_select_union_query(self, node: ast.SelectSetQuery):
def visit_select_set_query(self, node: ast.SelectSetQuery):
self._indent -= 1
ret = self.visit(node.initial_select_query)
if self.pretty:
Expand Down
4 changes: 2 additions & 2 deletions posthog/hogql/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ def visit(self, node: ast.AST | None):
raise QueryError("Too many CTE expansions (50+). Probably a CTE loop.")
return super().visit(node)

def visit_select_union_query(self, node: ast.SelectSetQuery):
def visit_select_set_query(self, node: ast.SelectSetQuery):
# all expressions combined by UNION ALL can use CTEs from the first expression
# so we put these CTEs to the scope
default_ctes = next(extract_select_queries(node)).ctes
if default_ctes:
self.scopes.append(ast.SelectQueryType(ctes=default_ctes))

node = super().visit_select_union_query(node)
node = super().visit_select_set_query(node)
node.type = ast.SelectUnionQueryType(
types=[node.initial_select_query.type, *(x.select_query.type for x in node.subsequent_select_queries)]
) # type: ignore
Expand Down
6 changes: 3 additions & 3 deletions posthog/hogql/visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def visit_select_query(self, node: ast.SelectQuery):
for expr in (node.window_exprs or {}).values():
self.visit(expr)

def visit_select_union_query(self, node: ast.SelectSetQuery):
def visit_select_set_query(self, node: ast.SelectSetQuery):
self.visit(node.initial_select_query)
for expr in node.subsequent_select_queries:
self.visit(expr.select_query)
Expand All @@ -172,7 +172,7 @@ def visit_select_query_type(self, node: ast.SelectQueryType):
for expr in node.columns.values():
self.visit(expr)

def visit_select_union_query_type(self, node: ast.SelectUnionQueryType):
def visit_select_set_query_type(self, node: ast.SelectUnionQueryType):
for type in node.types:
self.visit(type)

Expand Down Expand Up @@ -585,7 +585,7 @@ def visit_select_query(self, node: ast.SelectQuery):
view_name=node.view_name,
)

def visit_select_union_query(self, node: ast.SelectSetQuery):
def visit_select_set_query(self, node: ast.SelectSetQuery):
return ast.SelectSetQuery(
start=None if self.clear_locations else node.start,
end=None if self.clear_locations else node.end,
Expand Down

0 comments on commit 3743e83

Please sign in to comment.