jrderuiter opened a new issue, #52932:
URL: https://github.com/apache/airflow/issues/52932
### Apache Airflow version
3.0.2
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
The docs state that you can use the `source_dag_run` attribute to fetch
information about a triggering DAG when using asset-aware scheduling. However,
when I try to do so, this attribute doesn't seem to exist in Airflow 3,
resulting in an error:
```
[2025-07-06, 10:52:29] ERROR - Task failed with exception: source="task"
AttributeError: 'AssetEventDagRunReferenceResult' object has no attribute
'source_dag_run'
```
### What you think should happen instead?
The given example in the docs should work. The `source_dag_run` attribute
should be available and provide access to the source DagRun instance.
### How to reproduce
Code to reproduce:
```
import pendulum
from airflow.providers.standard.operators.python import PythonOperator
from airflow.sdk import DAG, Asset
from airflow.sdk.execution_time.comms import AssetEventDagRunReferenceResult
from airflow.sdk.execution_time.context import TriggeringAssetEventsAccessor
dataset = Asset("/data/events")
with DAG(dag_id="example_producer", start_date=pendulum.today()):
PythonOperator(
task_id="produce",
python_callable=lambda **context: print("Produce!"),
outlets=[dataset],
)
def _print_context(triggering_asset_events: TriggeringAssetEventsAccessor):
result: AssetEventDagRunReferenceResult =
triggering_asset_events[dataset][0]
print(result.source_dag_run)
with DAG(dag_id="example_consumer", schedule=[dataset],
start_date=pendulum.today()):
PythonOperator(
task_id="print_context",
python_callable=_print_context,
outlets=[dataset],
)
```
### Operating System
Docker
### Versions of Apache Airflow Providers
_No response_
### Deployment
Docker-Compose
### Deployment details
_No response_
### Anything else?
_No response_
### 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]