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

   ## Why
   
   Since #65958 the supervisor routes every task through 
`get_coordinator_manager().for_queue(ti.queue)`, so it depends on `queue`, 
`pool_slots` and `priority_weight` on the task instance it receives. Those 
fields lived in a `BaseTaskInstanceDTO` duplicated between airflow-core and 
task-sdk (#67174), kept aligned by an AST-comparison prek hook, while the 
`TaskInstance` schema in the versioned execution API spec still lacked them.
   
   That spec is already the designated home for this vocabulary: 
[`get_extra_schemas()`](https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/execution_api/app.py#L325-L349)
 injects `TaskInstance` (and `BundleInfo`, imported from 
`airflow.executors.workloads`) into the OpenAPI schema precisely so client SDKs 
generate these types from a versioned source. Adding the missing fields there 
gives one source of truth instead of two hand-synced copies.
   
   ## What
   
   - Add `queue`, `pool_slots` and `priority_weight` to the execution API 
`TaskInstance` schema, with an `AddTaskInstanceQueueFields` Cadwyn version 
change in the 2026-06-30 bundle, and regenerate the task-sdk datamodels.
   - Re-point `StartupDetails.ti`, `supervise_task()` and the coordinator 
interfaces at the generated `TaskInstance`.
   - Fold the core `TaskInstanceDTO` into a subclass of the schema model that 
only adds the executor-side fields (`external_executor_id` and 
`executor_config`, both excluded from serialization) and the `key` property.
   - Delete the duplicated task-sdk `execution_time.workloads` module and the 
`check-task-instance-dto-sync` hook. A round-trip test (executor DTO JSON 
validated by the SDK's generated model) covers the contract the hook used to 
enforce.
   - Remove `parent_context_carrier` from the DTO: it has no Python readers or 
writers anywhere in core, task-sdk or providers.
   
   ## Design notes
   
   - The three fields get defaults (`"default"`, `1`, `1`) instead of being 
required. The executor always sends real values (`ExecuteTask.make` validates 
from the ORM task instance, where the columns are non-null); defaults keep 
hand-built instances such as tests and `dry_run` runs valid, and match how 
`map_index` and `hostname` are already modelled in this schema.
   - No released artifact ships the deleted surfaces: the duplicated DTO module 
and the supervisor wire-schema bundle only exist on the unreleased 3.3 line, so 
no compat shims are needed. The supervisor wire-schema snapshot change rides 
the in-progress floor version of that bundle, where no `VersionChange` entry is 
possible.
   - The edge3 worker API spec regenerates via its existing hook because it 
embeds the workload TI shape. The checked-in TypeScript/Go clients under 
`plugins/www/openapi-gen` and `go-sdk/pkg/edgeapi` are not regenerated here: 
their codegen is not wired into prek and already lags the spec on main (the Go 
client was last regenerated in #56481), and the affected fields are optional in 
both.


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