rusackas commented on PR #41803: URL: https://github.com/apache/superset/pull/41803#issuecomment-5398750201
@eschutho fixed the no-paren `current_user` gap, `_extract_function_calls` now also matches by token type (reusing sqlglot's own `NO_PAREN_FUNCTIONS` set) instead of requiring a following `(`, plus a test. Also dropped the "as of this writing" phrasing, and added a hash-pinned test on `_parse`'s upstream source so a sqlglot bump breaks loudly here instead of drifting silently. Dug into the `CASE`/`if` case too, and it's real: `WHEN 1 THEN if` inside a routine body throws `Unbalanced BEGIN/END`. Turns out `THEN` is genuinely ambiguous between a procedural `CASE`/`IF` statement (where a nested block can legitimately follow) and a scalar `CASE` expression (where it can't), and telling them apart needs real statement-vs-expression tracking rather than a single lookback token. Documented it as a known limitation and pinned it with an xfail test instead of bolting more heuristics onto this file. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
