shahar1 opened a new pull request, #77418:
URL: https://github.com/apache/airflow/pull/77418
- Replace `str, Enum` with `StrEnum` (majority of the changes)
- Usage of `termios.tcgetwinsize` / `tcsetwinsize` in `process_utils`
- Remove dead code in task-sd
- Import from `typing` instead of `typing_extensions`
<details><summary>AI Summary</summary>
The minimum supported Python is 3.11, so several fallbacks kept for 3.10 are
dead code or can use the standard library directly.
- `str, Enum` to `StrEnum` for the 18 enums that already return `self.value`
from `__str__` (`state.py`, `DagRunType`, `TriggerRule`, `WeightRule`,
`JobState`, `CallbackType`, `ReprocessBehavior`, ...). `str()` and f-string
output are unchanged. Enums without a `__str__` override are left alone: for
them the swap changes `str(x)` / `f"{x}"`, so each needs its own call-site
audit. The generated `_generated.py` enums are untouched too.
- `StrEnum(...)` only accepts `str`, so two call sites are adjusted for
mypy: `JobState(str(job.state))` in the Execution API jobs route and `if
dag_run_state is not False:` in `clear_task_instances` (same condition as
`reset_dag_runs`).
- `execute_interactive`: `termios.tcgetwinsize` / `tcsetwinsize` replace the
`array` + `fcntl.ioctl` pair (pixel-size fields are no longer copied, only rows
and columns).
- Task SDK `raise_on_4xx_5xx`: drop the pre-3.11 variant and the
`hasattr(BaseException, "add_note")` rebind; the `add_note` body is the only
version.
- Task SDK `callback_runner`: `ParamSpec` from `typing`.
Local checks: the pre-commit stage on the changed files (ruff, ruff-format,
mypy for airflow-core and task-sdk) passes. I could not run the unit tests or
the `generate-openapi-spec` hook locally (Docker is unavailable here), so CI is
the first run of both. The OpenAPI spec should be unchanged, since `StrEnum`
keeps the same value set.
</details>
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Sonnet 5.5)
Generated-by: Claude Code (Sonnet 5.5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
---
* Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information. Note: commit author/co-author name and email in commits
become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License
Policy](https://www.apache.org/legal/resolved.html#category-x).
* For significant user-facing changes create newsfragment:
`{pr_number}.significant.rst`, in
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
You can add this file in a follow-up commit after the PR is created so you
know the PR number.
--
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]