rusackas commented on PR #41803:
URL: https://github.com/apache/superset/pull/41803#issuecomment-5351401913

   @sha174n nice catch on `_extract_function_calls`. It required 
`TokenType.VAR`, but `current_user`/`localtime` and a few others are reserved 
words that tokenize under their own type, so a denylisted `current_user()` call 
inside a UDF body would've slipped past. Fixed it to match on identifier-shaped 
token text instead, plus a test.
   
   Also fixed the `_parse` docstring, it still claimed sqlglot 30.8.0 but 
base.txt is now at 30.16.0. Diffed the two methods and nothing changed 
upstream, so the copy's still faithful, just the comment was stale.
   
   On the opaque body hiding table refs: checked Trino's SQL routine docs and 
queries (any SELECT) are flatly disallowed inside a routine body, so there's 
nothing for the opaque representation to hide there.
   
   Tried `apply_rls` against a UDF-bearing query too. The predicate lands on 
the real table fine and the WITH FUNCTION clause round-trips intact. It does 
throw a harmless `Cannot traverse scope ... type 'Var'` warning from sqlglot's 
own scope walker hitting the opaque body, just log noise, not a wrong result.


-- 
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]

Reply via email to