revert sql is/is not None back to ==  !=