You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "seanghaeli (via GitHub)" <gi...@apache.org> on 2026/06/23 02:43:37 UTC

[PR] Fix AwsBatchExecutor test_try_adopt_task_instances after TaskInstanceDTO hostname requirement [airflow]

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

   `test_try_adopt_task_instances` is currently **red on main** across the provider test jobs (Non-DB / LowestDeps / LatestBoto / Pendulum2 for `amazon`):
   
   ```
   airflow-core/src/airflow/executors/workloads/task.py:103: in make
       ser_ti = TaskInstanceDTO.model_validate(ti, from_attributes=True)
   pydantic_core.ValidationError: 1 validation error for TaskInstanceDTO
   hostname
     Input should be a valid string, input_value=<Mock name='mock.hostname'>, input_type=Mock
   ```
   
   #68027 routes orphaned-task adoption through `TaskInstanceDTO.model_validate(...)`, and `TaskInstanceDTO` inherits a required `hostname: str` from the SDK `TaskInstance`. The test builds `mock.Mock(spec=TaskInstance)` orphaned tasks and sets ~18 attributes but never `.hostname`, so validation receives a `Mock` and raises a `string_type` error.
   
   Fix: set `task.hostname` on the orphaned-task mocks so the DTO validates.
   
   **Verified locally** (breeze, py3.10): `test_try_adopt_task_instances` now passes (`1 passed`); previously failed with the ValidationError above.
   
   related: #68027
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) 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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix AwsBatchExecutor test_try_adopt_task_instances after TaskInstanceDTO hostname requirement [airflow]

Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 merged PR #68871:
URL: https://github.com/apache/airflow/pull/68871


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org