Skip to content

Commit

Permalink
final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Jun 21, 2024
1 parent 25c9aa0 commit ab42e2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions hogql_parser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,17 @@ class HogQLParseTreeConverter : public HogQLParserBaseVisitor {
}

VISIT(FuncStmt) {
PyObject* params;
string name = visitAsString(ctx->identifier());
vector<string> paramList = any_cast<vector<string>>(visit(ctx->identifierList()));
PyObject* params = X_PyList_FromStrings(paramList);
auto identifier_list_ctx = ctx->identifierList();
if (identifier_list_ctx) {
vector<string> paramList = any_cast<vector<string>>(visit(ctx->identifierList()));
params = X_PyList_FromStrings(paramList);
} else {
vector<string> paramList;
params = PyList_New(0);
}

if (!params) {
throw PyInternalError();
}
Expand Down
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.20",
version="1.0.21",
url="https://github.com/PostHog/posthog/tree/master/hogql_parser",
author="PostHog Inc.",
author_email="[email protected]",
Expand Down

0 comments on commit ab42e2f

Please sign in to comment.