From 894868b406b91388b2902d26d57f97a2708cdf31 Mon Sep 17 00:00:00 2001 From: Brent Bovenzi Date: Thu, 28 Apr 2022 16:39:38 -0400 Subject: [PATCH] Hide some task instance attributes (#23338) (cherry picked from commit f5f9c582a61e29a3bc007cb02a15579a42505565) --- airflow/www/views.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/airflow/www/views.py b/airflow/www/views.py index bc065db6b897e..f73b8107b957c 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -1606,10 +1606,22 @@ def task(self, session): ti_attrs: Optional[List[Tuple[str, Any]]] = None else: ti.refresh_from_task(task) + ti_attrs_to_skip = [ + 'dag_id', + 'key', + 'mark_success_url', + 'log', + 'log_url', + 'task', + ] # Some fields on TI are deprecated, but we don't want those warnings here. with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) - all_ti_attrs = ((name, getattr(ti, name)) for name in dir(ti) if not name.startswith("_")) + all_ti_attrs = ( + (name, getattr(ti, name)) + for name in dir(ti) + if not name.startswith("_") and name not in ti_attrs_to_skip + ) ti_attrs = sorted((name, attr) for name, attr in all_ti_attrs if not callable(attr)) attr_renderers = wwwutils.get_attr_renderer()