I have a boolean field in the mysql db table.
# table model
class TestCase(Base):
__tablename__ = \'test_cases\'
...
obsoleted = Column(\'obsole
I have a look what exact query is generated for using SQLAlchemy when == and is_ when the database dialect is Postgresql for boolean field:
for == we get:
field == False is converted to field = falsefield == True is converted to field = truefield == None is converted to field IS NULLfor is_() we get:
field.is_(False) is converted to field IS falsefield.is_(True) is converted to field IS truefield.is_(None) is converted to field IS NULLNOTE: is_(not None) will be evaluated to is_(bool(not None) what gives is_(True) giving field = true so you rather go for isnot(None) producing field IS NOT NULL