zmievsa opened a new pull request, #77184: URL: https://github.com/apache/airflow/pull/77184
The Task SDK uses Cadwyn for versions and data migrations and has no routes. Cadwyn 9.1 ships that part as `cadwyn-core`, which doesn't depend on FastAPI or Starlette, so the Task SDK can depend on it instead of on `cadwyn`. FastAPI stays installed for now because the Task SDK depends on airflow-core, which needs it. Once the Task SDK stops depending on airflow-core, Cadwyn won't pull FastAPI in. Both migrators keep their own loops. Since Cadwyn 9.1, calling Cadwyn's instructions with any object that has a `body` attribute is [supported API](https://docs.cadwyn.dev/9.1/theory/design_decisions/#supported-api), so the TODO about Cadwyn being tied to Starlette's request objects is gone. airflow-core moves to `cadwyn>=9.1.0rc1` in the same change as the Task SDK's `cadwyn-core>=9.1.0rc1`. `import cadwyn_core` fails when another version of `cadwyn` is installed, and with only the Task SDK's floor a resolver would accept `cadwyn` 9.0 next to `cadwyn-core` 9.1. Cadwyn 9.1.0 isn't released yet, so both floors point at 9.1.0rc1, which came out on 2026-11-16, inside the 4-day `exclude-newer` window. The root `pyproject.toml` gets temporary `exclude-newer-package` cutoffs for `cadwyn` and `cadwyn-core` so `uv lock` can see it. The lock changes only `cadwyn` (8.2.0 to 9.1.0rc1) and adds `cadwyn-core`. The floors move to `>=9.1.0` before this PR is marked ready. Removing the cutoffs is tracked in #77183. No newsfragment: nothing changes for users. related: #66837 Building the bundle no longer imports FastAPI. First use in a fresh interpreter on macOS (Apple Silicon, Python 3.14), median of 10 alternating base/head runs: | step | main (cadwyn 8.2.0) | this PR (cadwyn-core 9.1.0rc1) | |---|---|---| | control: `import airflow.sdk.execution_time.comms` | 970 ms | 975 ms | | `import airflow.sdk.execution_time.supervisor` | 353 ms | 351 ms | | `get_bundle()`, including the Cadwyn import | 629 ms | 555 ms | | first `downgrade()` | 43 ms | 48 ms | Neither side loads Cadwyn on the worker import path. The migration loops didn't change, so per-call cost wasn't measured again. Checks run locally: - `prek run --from-ref upstream/main --stage pre-commit` (includes mypy for task-sdk): passed. - `prek run --from-ref upstream/main --stage manual ...`: passed except `upgrade-dependency-floors`, which proposes the same boto3, botocore and azure floor bumps on an unchanged `main`. I left those out of this PR. - `uv run --project task-sdk pytest` on `execution_time/schema/`, `importers/yaml_importer/` and `coordinators/`: 849 passed, 1 failed. The failure is `TestClasspathLink::test_jvm_loads_jars_through_the_link`, which needs `javac`, and it fails the same way on `main` here. - `uv run --project airflow-core pytest` on `dag_processing/test_lang_sdk_processor.py` and `api_fastapi/execution_api/`: 1471 passed, 15 skipped. - `TestLazyCadwynImport` now also checks that the worker import path doesn't load `cadwyn_core`, and that building the bundle loads `cadwyn_core` without `cadwyn` or FastAPI. With `task-sdk/src` reverted to `main`, `test_accessing_bundle_loads_cadwyn_core_only` fails because the bundle loads `cadwyn`. - From the `breeze verify` list, these passed: `breeze testing task-sdk-tests`, both `breeze testing core-tests` runs, `breeze testing providers-tests --run-db-tests-only`, the four agent framework test runs, the `shared/*` tests and `breeze build-docs`. `mypy-providers` had no files to check. - `breeze testing providers-tests --skip-db-tests ...` failed twice, with 26 and then 25 failures, a different set each time. Almost all were amazon tests hitting `Timeout >60s` or crashing an xdist worker. The 48 tests that failed in either run pass when run on their own, and the same command on an unchanged `main` failed 41 amazon tests in the same ways. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: Claude Code (Opus 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]
