sha174n commented on PR #44496: URL: https://github.com/apache/superset/pull/44496#issuecomment-5799624511
Pushed ea679d9c07. Flagging it as a behavior change since your approvals, @aminghadersohi @rusackas, same as the earlier ones. `_nested_body_text` is now a `cached_property`. The comment strip it does was re-running on every call, and three gates ask for the same body in one request (one of them twice), so the same text was being scanned about five times per request. It is one pass now. The cache is safe rather than incidentally safe: the two methods that rebuild `_parsed` in place cannot reach a statement this returns text for. `set_limit` returns early unless the node is an `exp.Query`, and `remove_unbounded_top_level_order_by` needs an `order` argument, while a nested body is only ever carried by an opaque `exp.Command`, which is neither. That invariant is written into the docstring so a later edit to either method has a reason to re-check it. @bito-code-review on run #461a94: the second suggestion is fixed in the same commit, the assertion now uses an f-string matching the delimiter built four lines above it. Not taking the first one, `_MAX_LITERAL_NESTING` is what the test is pinning, so reaching for it is the point rather than an incidental coupling. -- 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]
