diff --git a/hogql_parser/parser.cpp b/hogql_parser/parser.cpp index 9488999e1e352..3679a392e5be2 100644 --- a/hogql_parser/parser.cpp +++ b/hogql_parser/parser.cpp @@ -581,9 +581,17 @@ class HogQLParseTreeConverter : public HogQLParserBaseVisitor { } VISIT(FuncStmt) { + PyObject* params; string name = visitAsString(ctx->identifier()); - vector paramList = any_cast>(visit(ctx->identifierList())); - PyObject* params = X_PyList_FromStrings(paramList); + auto identifier_list_ctx = ctx->identifierList(); + if (identifier_list_ctx) { + vector paramList = any_cast>(visit(ctx->identifierList())); + params = X_PyList_FromStrings(paramList); + } else { + vector paramList; + params = PyList_New(0); + } + if (!params) { throw PyInternalError(); } diff --git a/hogql_parser/setup.py b/hogql_parser/setup.py index 033736c65f4cc..2b19360e8dac9 100644 --- a/hogql_parser/setup.py +++ b/hogql_parser/setup.py @@ -32,7 +32,7 @@ setup( name="hogql_parser", - version="1.0.20", + version="1.0.21", url="https://github.com/PostHog/posthog/tree/master/hogql_parser", author="PostHog Inc.", author_email="hey@posthog.com",