0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 18:26:15 +01:00
posthog/hogql_parser/__init__.pyi
2024-06-21 11:22:39 -05:00

45 lines
1.4 KiB
Python

from posthog.hogql.ast import SelectQuery, SelectUnionQuery, Program
from posthog.hogql.base import AST
def parse_expr(expr: str, /, *, is_internal: bool = False) -> AST:
"""Parse the HogQL expression string into an AST.
If the expr `is_internal`, spans and notices won't be included in the AST.
"""
...
def parse_order_expr(expr: str, /, *, is_internal: bool = False) -> AST:
"""Parse the ORDER BY clause string into an AST.
If the expr `is_internal`, spans and notices won't be included in the AST.
"""
...
def parse_select(expr: str, /, *, is_internal: bool = False) -> SelectQuery | SelectUnionQuery:
"""Parse the HogQL SELECT statement string into an AST.
If the expr `is_internal`, spans and notices won't be included in the AST.
"""
...
def parse_full_template_string(expr: str, /, *, is_internal: bool = False) -> AST:
"""Parse a Hog template string into an AST.
If the expr `is_internal`, spans and notices won't be included in the AST.
"""
...
def parse_string_literal_text(value: str, /) -> str:
"""Unquote the string (an identifier or a string literal).
If the expr is `internal`, spans and notices won't be included in the AST.
"""
...
def parse_program(source: str, /, *, is_internal: bool = False) -> Program:
"""Parse a Hog program.
If the expr `is_internal`, spans and notices won't be included in the AST.
"""
...