You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Expression plugin uses the Python parser ("ast") to parse input into an AST and then transforms it into a DuckDB SQL string to run it within the database, rather than eval-ing the Python directly. This makes it hugely quicker but does make errors very hard to understand, especially because the parser understands far more complicated syntax than we have any intention of supporting.
Replacing this with a pypeg2 or similar parser would help. See branch nick/expression-parser
It'd also give us nicer column name escaping where columns have inconvenient names, maybe using `
Another aspect of this is that we quick often want to do something like mean(score1, score2, score3, score4) where those are scores from 4 replicates ... but we might not know how many replicates we're going to have at the time we write the program! So it'd be neat if our syntax allows us to wildcard columns, perhaps something like mean(score$) to average all columns matching that pattern. Obviously that's going to require a special parser.
Activity
nickzoic commentedon Mar 15, 2026
It'd also give us nicer column name escaping where columns have inconvenient names, maybe using `
Another aspect of this is that we quick often want to do something like
mean(score1, score2, score3, score4)where those are scores from 4 replicates ... but we might not know how many replicates we're going to have at the time we write the program! So it'd be neat if our syntax allows us to wildcard columns, perhaps something likemean(score$)to average all columns matching that pattern. Obviously that's going to require a special parser.nickzoic commentedon May 12, 2026
The pypeg2 parser is now merged! I think it's way better.