Skip to content

ST01 — Redundant ELSE NULL in CASE

Group: Structure · Auto-fixable: yes

A CASE expression already yields NULL when no branch matches, so ELSE NULL is redundant. Removed automatically.

bad: CASE WHEN x THEN 1 ELSE NULL END
good: CASE WHEN x THEN 1 END

Disable this rule in banshee.toml:

[lint]
exclude = ["ST01"]

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