You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2022/08/02 22:04:42 UTC

[airflow] branch main updated: Remove unused code in /grid endpoint (#25481)

This is an automated email from the ASF dual-hosted git repository.

jedcunningham pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 2550066e4d Remove unused code in /grid endpoint (#25481)
2550066e4d is described below

commit 2550066e4d105c8c5a030b7ef71dd95a890378b9
Author: Jed Cunningham <66...@users.noreply.github.com>
AuthorDate: Tue Aug 2 15:04:34 2022 -0700

    Remove unused code in /grid endpoint (#25481)
---
 airflow/www/views.py | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/airflow/www/views.py b/airflow/www/views.py
index d4bfc28c94..f072cc2f91 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -2709,29 +2709,6 @@ class Airflow(AirflowBaseView):
         if num_runs is None:
             num_runs = conf.getint('webserver', 'default_dag_run_display_number')
 
-        try:
-            base_date = _safe_parse_datetime(request.args["base_date"])
-        except (KeyError, ValueError):
-            base_date = dag.get_latest_execution_date() or timezone.utcnow()
-
-        dag_runs = (
-            session.query(DagRun)
-            .filter(DagRun.dag_id == dag.dag_id, DagRun.execution_date <= base_date)
-            .order_by(DagRun.execution_date.desc())
-            .limit(num_runs)
-            .all()
-        )
-        dag_run_dates = {dr.execution_date: alchemy_to_dict(dr) for dr in dag_runs}
-
-        max_date = max(dag_run_dates, default=None)
-
-        form = DateTimeWithNumRunsForm(
-            data={
-                'base_date': max_date or timezone.utcnow(),
-                'num_runs': num_runs,
-            }
-        )
-
         doc_md = wwwutils.wrapped_markdown(getattr(dag, 'doc_md', None))
 
         task_log_reader = TaskLogReader()
@@ -2749,9 +2726,7 @@ class Airflow(AirflowBaseView):
 
         return self.render_template(
             'airflow/grid.html',
-            operators=sorted({op.task_type: op for op in dag.tasks}.values(), key=lambda x: x.task_type),
             root=root,
-            form=form,
             dag=dag,
             doc_md=doc_md,
             num_runs=num_runs,