Skip to content

Commit

Permalink
Hide some task instance attributes (#23338)
Browse files Browse the repository at this point in the history
(cherry picked from commit f5f9c58)
  • Loading branch information
bbovenzi authored and ephraimbuddy committed May 8, 2022
1 parent a51b679 commit 894868b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 894868b

Please sign in to comment.