Skip to content

AM02 — Set operators (UNION/EXCEPT/INTERSECT) should state ALL or DISTINCT

Group: Ambiguity · Auto-fixable: no

UNION defaults to UNION DISTINCT, which silently deduplicates. Stating ALL or DISTINCT makes the intent — and the cost — explicit. Set prefer = all|distinct to require one specific modifier.

Disable this rule in banshee.toml:

[lint]
exclude = ["AM02"]

Or silence one line with -- noqa: AM02. See Linting.