MatrixManAtYrService opened a new issue, #23315:
URL: https://github.com/apache/airflow/issues/23315
### Apache Airflow version
main (development)
### What happened
This happens for any dag with a task expansion. For instance:
```python
from datetime import datetime
from airflow import DAG
from airflow.operators.bash import BashOperator
with DAG(
dag_id="simple_mapped",
start_date=datetime(1970, 1, 1),
schedule_interval=None,
) as dag:
BashOperator.partial(task_id="hello_world").expand(
bash_command=["echo hello", "echo world"]
)
```
I ran `airflow dags show simple_mapped` and instead of graphviz DOT
notation, I saw this:
```
[2022-04-27 19:27:39,424] {dagbag.py:507} INFO - Filling up the DagBag from
/Users/matt/2022/04/27/dags
Traceback (most recent call last):
File "/Users/matt/src/qa-scenario-dags/venv/bin/airflow", line 8, in
<module>
sys.exit(main())
File
"/Users/matt/src/qa-scenario-dags/venv/lib/python3.9/site-packages/airflow/__main__.py",
line 38, in main
args.func(args)
File
"/Users/matt/src/qa-scenario-dags/venv/lib/python3.9/site-packages/airflow/cli/cli_parser.py",
line 51, in command
return func(*args, **kwargs)
File
"/Users/matt/src/qa-scenario-dags/venv/lib/python3.9/site-packages/airflow/cli/commands/dag_command.py",
line 205, in dag_show
dot = render_dag(dag)
File
"/Users/matt/src/qa-scenario-dags/venv/lib/python3.9/site-packages/airflow/utils/dot_renderer.py",
line 188, in render_dag
_draw_nodes(dag.task_group, dot, states_by_task_id)
File
"/Users/matt/src/qa-scenario-dags/venv/lib/python3.9/site-packages/airflow/utils/dot_renderer.py",
line 125, in _draw_nodes
_draw_task_group(node, parent_graph, states_by_task_id)
File
"/Users/matt/src/qa-scenario-dags/venv/lib/python3.9/site-packages/airflow/utils/dot_renderer.py",
line 110, in _draw_task_group
_draw_nodes(child, parent_graph, states_by_task_id)
File
"/Users/matt/src/qa-scenario-dags/venv/lib/python3.9/site-packages/airflow/utils/dot_renderer.py",
line 121, in _draw_nodes
raise AirflowException(f"The node {node} should be TaskGroup and is not")
airflow.exceptions.AirflowException: The node <Mapped(BashOperator):
hello_world> should be TaskGroup and is not
```
### What you think should happen instead
I should see something about the dag structure.
### How to reproduce
run `airflow dags show` for any dag with a task expansion
### Operating System
MacOS, venv
### Versions of Apache Airflow Providers
n/a
### Deployment
Virtualenv installation
### Deployment details
```
❯ airflow version
2.3.0.dev0
```
cloned at 4f6fe727a
### Anything else
There's a related card:
https://github.com/apache/airflow/projects/12#card-76605124
But I don't think that functionality is making it into 2.3.0, so maybe we
need something here in the meantime?
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]