Srabasti commented on issue #53637:
URL: https://github.com/apache/airflow/issues/53637#issuecomment-3556235050
I was trying to replicate the error using DAG code as below, however not
seeing any errors.
Can you please suggest any changes needed to replicate the error @obarisk or
someone else?
TIA!
<!-- Failed to upload "image.png" -->
#
"""Example DAG demonstrating the issue of PR53637."""
```
from datetime import datetime
from airflow.models.taskinstance import TaskInstance
#from airflow.models.dagrun import DagRun #commenting to try and replicate
error scenario
from airflow.sdk.api.datamodels._generated import DagRun
from airflow.sdk import dag, task
@dag(
dag_id='pr_53637_context_types',
schedule=None,
start_date=datetime(2025, 11, 16),
catchup=False,
tags=['issue_pr53637'],
)
def document_context():
@task
def print_ti_info(task_instance: TaskInstance, dag_run: DagRun):
print(f"Run ID: {task_instance.run_id}")
print(dag_run.__class__)
## airflow >= 3.0 airflow.sdk.api.datamodels._generated.DagRun
## airflow < 3.0 airflow.models.dagrun.DagRun
print_ti_info()
document_context()
```
--
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]