-
Notifications
You must be signed in to change notification settings - Fork 16.8k
Asset graph blank when DAG contains TriggerDagRunOperator, unregistered "trigger" node type in frontend causes silent render failure #64621
Description
Apache Airflow version
3.1.7+astro.2
What happened and how to reproduce it?
When a DAG contains a TriggerDagRunOperator, the asset dependency graph API returns nodes with "type": "trigger". The Airflow 3 frontend asset graph renderer does not have a registered component for the trigger node type, causing the entire graph to render blank with no error shown.
Reproduction Steps:
- Create the following two DAGs and a shared assets file:
assets_test.py:
from airflow.sdk import Asset
test_asset = Asset(name="test_asset")
trigger_test_asset = Asset(name="trigger_test_asset")
producer_no_trigger.py (graph renders correctly):
from airflow.sdk import DAG
from airflow.providers.standard.operators.python import PythonOperator
from datetime import datetime
from dags.assets_test import test_asset
with DAG(dag_id="producer_no_trigger", schedule=None, start_date=datetime(2021,1,1), catchup=False):
PythonOperator(task_id="emit", python_callable=lambda: None, outlets=[test_asset])
producer_with_trigger.py (graph does NOT render):
from airflow.sdk import DAG
from airflow.providers.standard.operators.python import PythonOperator
from airflow.providers.standard.operators.trigger_dagrun import TriggerDagRunOperator
from datetime import datetime
from dags.assets_test import trigger_test_asset
with DAG(dag_id="producer_with_trigger", schedule=None, start_date=datetime(2021,1,1), catchup=False):
emit = PythonOperator(task_id="emit", python_callable=lambda: None, outlets=[trigger_test_asset])
trigger = TriggerDagRunOperator(task_id="trigger_something", trigger_dag_id="some_dag", wait_for_completion=False)
emit >> trigger
- Deploy all files and wait for them to parse
- Go to Assets tab → click
test_asset→ graph renders correctly - Go to Assets tab → click
trigger_test_asset→ graph is blank
The difference in the dependency API responses confirms the root cause:
test_asset (graph renders) dependency API response:
{
"edges": [
{
"source_id": "dag:producer_no_trigger",
"target_id": "asset:10"
}
],
"nodes": [
{
"id": "dag:producer_no_trigger",
"label": "producer_no_trigger",
"type": "dag"
},
{
"id": "asset:10",
"label": "test_asset",
"type": "asset"
}
]
}
trigger_test_asset (graph blank) dependency API response:
{
"edges": [
{
"source_id": "dag:producer_with_trigger",
"target_id": "asset:9"
},
{
"source_id": "dag:producer_with_trigger",
"target_id": "trigger:producer_with_trigger:some_dag:trigger_something"
},
{
"source_id": "trigger:producer_with_trigger:some_dag:trigger_something",
"target_id": "dag:some_dag"
}
],
"nodes": [
{
"id": "dag:producer_with_trigger",
"label": "producer_with_trigger",
"type": "dag"
},
{
"id": "asset:9",
"label": "trigger_test_asset",
"type": "asset"
},
{
"id": "trigger:producer_with_trigger:some_dag:trigger_something",
"label": "trigger_something",
"type": "trigger"
}
]
}
What you think should happen instead?
The asset graph should render trigger type nodes visually. Currently the entire graph fails to render silently when any trigger type node is present in the response.
Operating System
Debian GNU/Linux 12 (bookworm)
Versions of Apache Airflow Providers
apache-airflow-providers-common-compat==1.13.1
apache-airflow-providers-common-io==1.7.1
apache-airflow-providers-common-sql==1.31.0
apache-airflow-providers-elasticsearch==6.4.4
apache-airflow-providers-openlineage==2.10.2
apache-airflow-providers-smtp==2.4.2
apache-airflow-providers-standard==1.11.1
Deployment
Astronomer
Deployment details
Astronomer Runtime 3.1-13 based on Apache Airflow 3.1.7+astro.2
Anything else?
Confirmed from Airflow source code that trigger is not a registered node type in the frontend.
In airflow-core/src/airflow/ui/src/components/Graph/graphTypes.ts at https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/ui/src/components/Graph/graphTypes.ts:
typescriptexport const nodeTypes = {
asset: AssetNode,
"asset-alias": AliasNode,
"asset-condition": AssetConditionNode,
"asset-name-ref": DefaultNode,
"asset-uri-ref": DefaultNode,
dag: DagNode,
join: JoinNode,
task: TaskNode,
};
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct