mirror of
https://github.com/apache/superset.git
synced 2026-07-13 10:15:58 +00:00
Add a failing regression test for #36113. `sanitize_clause` round-trips a user-authored clause through SQLGlot's dialect generator and returns the re-rendered SQL. The Postgres dialect (borrowed by several engines) rewrites `ROUND(AVG(x), n)` to `ROUND(CAST(AVG(x) AS DECIMAL), n)` at generation time; on engines whose unqualified DECIMAL defaults to scale 0 the injected cast rounds the aggregate before the explicit ROUND, producing wrong values. The test asserts the clause is returned unchanged and currently fails for postgresql/cockroachdb/netezza/hana. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>