Repository: incubator-airflow Updated Branches: refs/heads/master 62f5034d6 -> 44fcabc36
[AIRFLOW-809][AIRFLOW-1] Use __eq__ ColumnOperator When Testing Booleans The .is_ ColumnOperator causes the SqlAlchemy's MSSQL dialect to produce IS 0 when given a value of False rather than a value of None. The __eq__ ColumnOperator does this same test with the added benefit that it will modify the resulting expression from and == to a IS NULL when the target is None. This change replaces all is_ ColumnOperators that are doing boolean comparisons and leaves all is_ ColumnOperators that are checking for None values. Closes #2022 from gritlogic/AIRFLOW-809 Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/44fcabc3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/44fcabc3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/44fcabc3 Branch: refs/heads/master Commit: 44fcabc36048cd6e80660fc023afce85e3d435a0 Parents: 62f5034 Author: Chad Henderson <chender...@gritlogic.com> Authored: Sun Feb 19 10:03:18 2017 +0100 Committer: Bolke de Bruin <bo...@xs4all.nl> Committed: Sun Feb 19 10:03:18 2017 +0100 ---------------------------------------------------------------------- airflow/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/44fcabc3/airflow/models.py ---------------------------------------------------------------------- diff --git a/airflow/models.py b/airflow/models.py index 6ed6115..8965ade 100755 --- a/airflow/models.py +++ b/airflow/models.py @@ -468,7 +468,7 @@ class DagBag(BaseDagBag, LoggingMixin): def paused_dags(self): session = settings.Session() dag_ids = [dp.dag_id for dp in session.query(DagModel).filter( - DagModel.is_paused.is_(True))] + DagModel.is_paused.__eq__(True))] session.commit() session.close() return dag_ids @@ -2800,7 +2800,7 @@ class DAG(BaseDag, LoggingMixin): DR.dag_id == self.dag_id, ) if not include_externally_triggered: - qry = qry.filter(DR.external_trigger.is_(False)) + qry = qry.filter(DR.external_trigger.__eq__(False)) qry = qry.order_by(DR.execution_date.desc())