This is an automated email from the ASF dual-hosted git repository.
potiuk 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 5a1889a7e7 Merge multiple isintance calls for the same object in a
single call (#33767)
5a1889a7e7 is described below
commit 5a1889a7e70114317b96fefa4b1e3f47ae15cc10
Author: Hussein Awala <[email protected]>
AuthorDate: Sat Aug 26 09:03:55 2023 +0200
Merge multiple isintance calls for the same object in a single call (#33767)
---
airflow/utils/dot_renderer.py | 2 +-
airflow/www/views.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/airflow/utils/dot_renderer.py b/airflow/utils/dot_renderer.py
index 7b895f739f..b6e2cdb7b0 100644
--- a/airflow/utils/dot_renderer.py
+++ b/airflow/utils/dot_renderer.py
@@ -120,7 +120,7 @@ def _draw_nodes(
node: DependencyMixin, parent_graph: graphviz.Digraph, states_by_task_id:
dict[str, str] | None
) -> None:
"""Draw the node and its children on the given parent_graph recursively."""
- if isinstance(node, BaseOperator) or isinstance(node, MappedOperator):
+ if isinstance(node, (BaseOperator, MappedOperator)):
_draw_task(node, parent_graph, states_by_task_id)
else:
if not isinstance(node, TaskGroup):
diff --git a/airflow/www/views.py b/airflow/www/views.py
index 275432f9bc..353ce14f23 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -4254,7 +4254,7 @@ def action_has_dag_edit_access(action_func: Callable) ->
Callable:
dag_ids: set[str] = set()
elif isinstance(items, list):
dag_ids = {item.dag_id for item in items if item is not None}
- elif isinstance(items, TaskInstance) or isinstance(items, DagRun):
+ elif isinstance(items, (TaskInstance, DagRun)):
dag_ids = {items.dag_id}
else:
raise ValueError(