jason810496 opened a new pull request, #67174:
URL: https://github.com/apache/airflow/pull/67174

   - related: https://github.com/apache/airflow/pull/65958
   
   ### Why
   
   Extract the `BaseTaskInstanceDTO` from 
https://github.com/apache/airflow/pull/65958 PR, as the pointed out in 
https://github.com/apache/airflow/pull/65958#discussion_r3156881997 comment 
that the `airflow.sdk.api.datamodels._generated.TaskInstance` usage in Task-SDK 
since Airflow 3.0 is inaccurate.
   
   Additionally, this improvement should not be blocked by the AIP-108 vote. 
   
   ### What
   
   Extract the executor/Task-SDK common fields of ``TaskInstanceDTO`` into 
``BaseTaskInstanceDTO`` so the same minimal schema can be defined in both:
   
   - ``airflow-core/src/airflow/executors/workloads/task.py``
   - ``task-sdk/src/airflow/sdk/execution_time/workloads/task.py``
   
   The classes are intentionally duplicated rather than shared, because the 
core ``TaskInstanceDTO`` subclass needs the executor-specific 
``external_executor_id`` field and a ``key`` property that depends on 
``airflow.models.taskinstancekey``, which the Task SDK distribution cannot 
import.
   
   A new prek hook ``check-task-instance-dto-sync`` AST-compares the bases and 
annotated fields of ``BaseTaskInstanceDTO`` in both files and fails when they 
drift, so the duplication stays in sync. The hook runs only when either 
``task.py`` changes.
   
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes, with help of Claude Code Opus 4.7 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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