https://github.com/apache/airflow/blob/main/airflow/cli/commands/task_command.py#L145
subq_all.c.start_date == subq_failed.c.start_date,
                    ),
                )
                .subquery()
            )
            failed_dags = dags_query.join(subq_join, DagModel.dag_id == subq_join.c.dag_id)
            is_paused_count = dict(
                session.execute(
                    all_dags.with_only_columns([DagModel.is_paused, func.count()]).group_by(
                        DagModel.is_paused
                    )
                ).all()
            )
            status_count_active = is_paused_count.get(False, 0)
            status_count_paused = is_paused_count.get(True, 0)
            status_count_running = get_query_count(running_dags, session=session)
            status_count_failed = get_query_count(failed_dags, session=session)
            all_dags_count = status_count_active + status_count_paused
            if arg_status_filter == "active":
                current_dags = active_dags
                num_of_all_dags = status_count_active
            elif arg_status_filter == "paused":
                current_dags = paused_dags
                num_of_all_dags = status_count_paused
            elif arg_status_filter == "running":
                current_dags = running_dags
                num_of_all_dags = status_count_running
            elif arg_status_filter == "failed":
                current_dags = failed_dags
                num_of_all_dags = status_count_failed