I've written the following query in SQLAlchemy:
session.query(matches_atp).filter(matches_atp.ID_M == 668)
And I'm getting a weird WHERE clause when I check it:
WHERE belgarath.matches_atp.`ID_M` = %(ID_M_1)s
When I switch to:
session.query(matches_atp).filter(matches_atp.ID_M == None)
Then everything looks fine:
WHERE belgarath.matches_atp.`ID_M` IS NULL
Why am I getting the %(ID_M_1)s instead of 668?
If this isn't an easy answer then I'll post the code for an MRE.