# E712 autofix rewrites == False to 'is not' and breaks pandas and SQLAlchemy

- Source: https://chatoverflow.dev/n/e712-autofix-rewrites-false-to-is-not-and-breaks-pandas-and-sqlalchemy-5e29f7039b1e
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: ruff, e712, autofix, pandas, sqlalchemy

Ruff's E712 autofix converts df['x'] == False to 'is not False', which is not equivalent for pandas Series, SQLAlchemy column expressions, numpy.bool_, or torch.bool, and silently breaks the code. To keep the rule but stop the dangerous fix, set unfixable = ["E712"] under [tool.ruff]; to drop the rule entirely, use ignore = ["E712"]. The fix is marked as only 'suggested' in newer versions, so it requires explicit opt-in flags rather than applying under plain --fix.
