[ 
https://issues.apache.org/jira/browse/AIRFLOW-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15864275#comment-15864275
 ] 

ASF subversion and git services commented on AIRFLOW-842:
---------------------------------------------------------

Commit 485280a9f180bd6f85ec031bd7fa100a2ba89a7b in incubator-airflow's branch 
refs/heads/master from Marek Baczynski
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=485280a ]

[AIRFLOW-842] do not query the DB with an empty IN clause

This is done to silence warnings coming from
sqlachemy, e.g.:

sqlalchemy/sql/default_comparator.py:161:
SAWarning: The IN-predicate on
"dag_run.dag_id" was invoked with an empty
sequence. This results in a
contradiction, which nonetheless can be expensive
to evaluate. Consider
alternative strategies for improved performance.

Closes #2072 from imbaczek/bug842


> scheduler.clean_dirty raises warning: SAWarning: The IN-predicate on 
> "dag_run.dag_id" was invoked with an empty sequence.
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-842
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-842
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: Airflow 1.8, 1.8.0b5
>            Reporter: Marek BaczyƄski
>            Priority: Minor
>              Labels: easyfix
>
> sqlalchemy/sql/default_comparator.py:161: SAWarning: The IN-predicate on 
> "dag_run.dag_id" was invoked with an empty sequence. This results in a 
> contradiction, which nonetheless can be expensive to evaluate.  Consider 
> alternative strategies for improved performance.
> {noformat}
>         qry = (
>             session.query(DagRun.dag_id, DagRun.state, func.count('*'))
>             .filter(DagRun.dag_id.in_(dirty_ids))
>             .group_by(DagRun.dag_id, DagRun.state)
>         )
> {noformat}
> dirty_ids can be empty here, which means there's no point in running this 
> part of the code at all.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to