AM01 — DISTINCT is redundant with GROUP BY
Group: Ambiguity · Auto-fixable: no
GROUP BY already yields one row per group, so a leading DISTINCT only adds a
needless sort. Drop the DISTINCT. (DISTINCT ON is a different feature — see
ST08.)
Example
Section titled “Example”bad: SELECT DISTINCT a FROM t GROUP BY agood: SELECT a FROM t GROUP BY aConfigure
Section titled “Configure”Disable this rule in banshee.toml:
[lint]exclude = ["AM01"]Or silence one line with -- noqa: AM01. See Linting.