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

   ## Why
   
   The execution-time `schema` package imported `cadwyn` (pulling in 
FastAPI/Starlette/Jinja2) at module load, but `cadwyn` is only needed on the 
Multi-Lang task execution path. Imported lazily after the Celery prefork, every 
pool worker paid this in private pages, raising worker memory on Python 3.14.
   
   ## What
   
   - Build the supervisor `VersionBundle` lazily behind a `functools.cache`d 
`get_bundle()`, with the `cadwyn` import inside it.
   - Defer `generate_versioned_models` into 
`SchemaVersionMigrator._versioned_class`, the only path that needs it.
   - Keep `from ...schema import bundle` working via module-level 
`__getattr__`, so `cadwyn` loads only when `bundle` is accessed.
   - Add a regression test asserting the worker import graph stays 
`cadwyn`/`fastapi`-free, and that accessing `bundle` loads `cadwyn`.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes, with help of 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to