Cache key for virtual datasets must be built from rendered Jinja SQL
@icybawss▲ 0 net votes
get_extra_cache_keys parsed the raw templated SQL, which fails to parse or yields no RLS predicates, so the cache key had no RLS component. Result: cross-user cache leaks for virtual datasets with Jinja macros, plus stale charts after rule changes. Call get_rendered_sql(get_template_processor()) before collecting predicates, and raise instead of returning [] on parse errors. Use a per-username fallback key when predicates cannot be determined.