You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/02/17 08:43:11 UTC
[GitHub] [airflow] yuqian90 opened a new pull request #14269: Airflow show
yuqian90 opened a new pull request #14269:
URL: https://github.com/apache/airflow/pull/14269
closes: #13053
Make `airflow dags show` display `TaskGroup`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on pull request #14269: Make airflow dags show display TaskGroup.
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14269:
URL: https://github.com/apache/airflow/pull/14269#issuecomment-785979381
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] turbaszek commented on a change in pull request #14269: Make airflow dags show display TaskGroup.
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #14269:
URL: https://github.com/apache/airflow/pull/14269#discussion_r578331430
##########
File path: airflow/utils/dot_renderer.py
##########
@@ -42,6 +45,80 @@ def _refine_color(color: str):
return color
+def _draw_nodes(node: TaskMixin, parent_graph: graphviz.Digraph, states_by_task_id: Dict[str, str]) -> None:
+ """Draw the node and its children on the given parent_graph recursively."""
+ if isinstance(node, BaseOperator):
+ # Draw task
+ if states_by_task_id:
+ state = states_by_task_id.get(node.task_id, State.NONE)
+ color = State.color_fg(state)
+ fill_color = State.color(state)
+ else:
+ color = node.ui_fgcolor
+ fill_color = node.ui_color
+
+ parent_graph.node(
+ node.task_id,
+ _attributes={
+ "label": node.label,
+ "shape": "rectangle",
+ "style": "filled,rounded",
+ "color": _refine_color(color),
+ "fillcolor": _refine_color(fill_color),
+ },
+ )
Review comment:
How about introducing `_draw_task` and `_draw_task_group` to encapsulate the logic and split logic of `_draw_nodes` into smaller pieces?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] yuqian90 commented on pull request #14269: Make airflow dags show display TaskGroup.
Posted by GitBox <gi...@apache.org>.
yuqian90 commented on pull request #14269:
URL: https://github.com/apache/airflow/pull/14269#issuecomment-781222892
@mik-laj @kaxil could you take a look?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] yuqian90 commented on a change in pull request #14269: Make airflow dags show display TaskGroup.
Posted by GitBox <gi...@apache.org>.
yuqian90 commented on a change in pull request #14269:
URL: https://github.com/apache/airflow/pull/14269#discussion_r582555696
##########
File path: airflow/utils/dot_renderer.py
##########
@@ -42,6 +45,80 @@ def _refine_color(color: str):
return color
+def _draw_nodes(node: TaskMixin, parent_graph: graphviz.Digraph, states_by_task_id: Dict[str, str]) -> None:
+ """Draw the node and its children on the given parent_graph recursively."""
+ if isinstance(node, BaseOperator):
+ # Draw task
+ if states_by_task_id:
+ state = states_by_task_id.get(node.task_id, State.NONE)
+ color = State.color_fg(state)
+ fill_color = State.color(state)
+ else:
+ color = node.ui_fgcolor
+ fill_color = node.ui_color
+
+ parent_graph.node(
+ node.task_id,
+ _attributes={
+ "label": node.label,
+ "shape": "rectangle",
+ "style": "filled,rounded",
+ "color": _refine_color(color),
+ "fillcolor": _refine_color(fill_color),
+ },
+ )
Review comment:
Thanks @turbaszek . Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] yuqian90 commented on pull request #14269: Make airflow dags show display TaskGroup.
Posted by GitBox <gi...@apache.org>.
yuqian90 commented on pull request #14269:
URL: https://github.com/apache/airflow/pull/14269#issuecomment-787245888
Hi @Kaxil, thanks for merging this PR. Can it go into 2.0.2?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil merged pull request #14269: Make airflow dags show display TaskGroup.
Posted by GitBox <gi...@apache.org>.
kaxil merged pull request #14269:
URL: https://github.com/apache/airflow/pull/14269
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org