You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jobs@airflow.apache.org by GitBox <gi...@apache.org> on 2025/07/22 23:07:32 UTC
[GH] (airflow/add-dagrun-in-context): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/add-dagrun-in-context has failed.
Run started by GitHub user kaxil (triggered by kaxil).
Head commit for run:
a07a914117ea695bf172886ec38d643c9bea11c8 / Kaxil Naik <ka...@gmail.com>
Restore ``get_previous_dagrun`` functionality for task context
Add `get_previous_dagrun` method to RuntimeTaskInstance to replace the removed
`DagRun.get_previous_dagrun()` method from Airflow 2.x. This enables users to
access previous DAG run information from task context for conditional logic
like notifications on state changes.
Changes:
- Add `GetPreviousDagRun` message and `PreviousDagRunResult` response in comms
- Add `get_previous_dagrun` instance method to `RuntimeTaskInstance`
- Add `/dag-runs/{dag_id}/previous` API endpoint with optional state filtering
- Add `get_previous` method to DagRunOperations API client
- Update supervisor to handle `GetPreviousDagRun` messages
Usage:
```python
def my_task(context):
ti = context["ti"]
previous_run = ti.get_previous_dagrun(state="success")
if previous_run:
# Access previous run metadata
print(f"Previous run: {previous_run.dag_run.run_id}")
```
Fixes #53628
Report URL: https://github.com/apache/airflow/actions/runs/16456826881
With regards,
GitHub Actions via GitBox
---------------------------------------------------------------------
To unsubscribe, e-mail: jobs-unsubscribe@airflow.apache.org
For additional commands, e-mail: jobs-help@airflow.apache.org