I was going to log an issue on the SQLAlchemy site, but before I did I just wanted to check I hadn't missed anything. I have asked on IRC and I think this could possibly be a legit issue.
What it boils down to is the != filters are not taking into account empty/NULL cells.
So lets say for instance
Session.query(Table).\
filter(Table.column != 1).all()
Now I would expect this to return all records where the value was not equal to 1. However, what it actually returns is a list of records that have data in, that isn't equal to 1.
So if for example column was a NULL/empty value, it would not be returned by this query, to which I (and others) would expect it to be.
Now obviously it's best practice to use NOT NULL on creating columns, but I just wanted to see if there was a fix for this, or whether its worth filing a bug