obarisk commented on code in PR #54693:
URL: https://github.com/apache/airflow/pull/54693#discussion_r2314721512


##########
devel-common/src/docs/shared/template-examples/taskflow-kwargs.rst:
##########
@@ -17,15 +17,14 @@
 
  .. code-block:: python
 
-    from airflow.models.taskinstance import TaskInstance
-    from airflow.models.dagrun import DagRun
+    from airflow.sdk.api.datamodels._generated import DagRun
+    from airflow.sdk.execution_time.task_runner import RuntimeTaskInstance

Review Comment:
   But we lack some attribute in the Protocol class.
   
   the comparision of DagRun. (TaskInstance is too large to post here.).
   
   ```python
   class DagRunProtocol(Protocol):
       """Minimal interface for a DAG run available during the execution."""
   
       dag_id: str
       run_id: str
       logical_date: AwareDatetime | None
       data_interval_start: AwareDatetime | None
       data_interval_end: AwareDatetime | None
       start_date: AwareDatetime
       end_date: AwareDatetime | None
       run_type: Any
       run_after: AwareDatetime
       conf: dict[str, Any] | None
   
   class DagRun(BaseModel):
       """
       Schema for DagRun model with minimal required fields needed for Runtime.
       """
   
       model_config = ConfigDict(
           extra="forbid",
       )
       dag_id: Annotated[str, Field(title="Dag Id")]
       run_id: Annotated[str, Field(title="Run Id")]
       logical_date: Annotated[AwareDatetime | None, Field(title="Logical 
Date")] = None
       data_interval_start: Annotated[AwareDatetime | None, Field(title="Data 
Interval Start")] = None
       data_interval_end: Annotated[AwareDatetime | None, Field(title="Data 
Interval End")] = None
       run_after: Annotated[AwareDatetime, Field(title="Run After")]
       start_date: Annotated[AwareDatetime, Field(title="Start Date")]
       end_date: Annotated[AwareDatetime | None, Field(title="End Date")] = None
       clear_number: Annotated[int | None, Field(title="Clear Number")] = 0
       run_type: DagRunType
       state: DagRunState
       conf: Annotated[dict[str, Any] | None, Field(title="Conf")] = None
       consumed_asset_events: Annotated[list[AssetEventDagRunReference], 
Field(title="Consumed Asset Events")]
   ```



-- 
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]

Reply via email to