[
https://issues.apache.org/jira/browse/AIRFLOW-3587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16730093#comment-16730093
]
ASF GitHub Bot commented on AIRFLOW-3587:
-
XD-DENG commented on pull request #4395: [AIRFLOW-3587] Remove unnecessary
condition checks in dag_stats & task_stats
URL: https://github.com/apache/incubator-airflow/pull/4395
### Jira
- https://issues.apache.org/jira/browse/AIRFLOW-3587
### Description
- [x] Here are some details about my PR, including screenshots of any UI
changes:
These two condition checks will always pass no matter whether "all_dags" is
in filter_dag_ids.
**Reasoning:**
- if `"all_dags" in filter_dag_ids == True`, `filter_dag_ids` will be
updated into a list of all DAG IDs (no `"all_dags"` inside)
- if `"all_dags" in filter_dag_ids == False`, `filter_dag_ids` will not be
touched. It will still be a set of DAG IDs, or empty set.
In either case,
- there is no point to check whether `"all_dags"` is in `filter_dag_ids`,
because for sure it will not.
- then what's the point to check `dag_id in filter_dag_ids` in a `for loop`
of `for dag_id in filter_dag_ids`?
### Code Quality
- [x] Passes `flake8`
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org
> To remove unnecessary condition checks in dag_stats & task_stats
>
>
> Key: AIRFLOW-3587
> URL: https://issues.apache.org/jira/browse/AIRFLOW-3587
> Project: Apache Airflow
> Issue Type: Improvement
> Components: webapp
>Reporter: Xiaodong DENG
>Assignee: Xiaodong DENG
>Priority: Minor
>
> This is an issue in current master branch.
>
> There are two unnecessary condition checks in
> [airflow/www_rbac/views.py|https://github.com/XD-DENG/incubator-airflow/compare/65843a63aaa4...0c50b25a978c#diff-77df5adb32d964f37748c4557ffb3c4c]
> [dag_stats &
> task_stats|https://github.com/XD-DENG/incubator-airflow/commit/0c50b25a978c418bb61316a94d28551417d57511].
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)