GitHub user matthewblock edited a comment on the discussion: DAG callback
`context` does not have `dag_run` set in Airflow 3 but it is set in Airflow 2.
I'm running into similar issues - I have been using `airflow.models.XXX` for
type hints, so I could tell which information was available in each object.
```
from airflow.models.task_instance import TaskInstance
def my_on_success_callback(context):
ti: TaskInstance = context["task_instance"]
print(f"{ti=}")
```
The above now gives me ```RuntimeError: Direct database access via the ORM is
not allowed in Airflow 3.0.```
Is there a drop in replacement via `airflow.sdk` or are we expected to memorize
which fields are in which object?
Where can we find what each `context` contains, for each callback?
GitHub link:
https://github.com/apache/airflow/discussions/53618#discussioncomment-14651133
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]