AP24110011695 opened a new pull request, #76869:
URL: https://github.com/apache/airflow/pull/76869
### What this adds
The `airflow` package root resolves its public names through `__getattr__`
(PEP-562 lazy imports, including the deprecated shims), but had no `__dir__`.
So `dir(airflow)` — the surface IDEs, REPLs and tooling discover — hid `DAG`,
`Asset`, `XComArg`, `version` and the deprecated shims until each was accessed
manually.
### Changes
- `__dir__` added to the package root: `sorted({*globals(),
*__lazy_imports})` — mirrors the `__dir__` added to `airflow.sdk` in #76486,
and covers the deprecated shim entries too (they remain accessible with a
warning, so discovery should list them).
- New unit test `test_dir_exposes_lazy_imports` pins the contract: every
`__lazy_imports` name must appear in `dir(airflow)`.
### Testing
- `test_dir_exposes_lazy_imports` fails without the `__dir__` addition (the
lazy names are absent from `dir()`) and passes with it — verified by
construction and by a standalone mirror of the module state; the full unit run
executes in CI where the monorepo symlinks (`airflow._shared.*`) resolve on
Linux.
- `ruff` 0.17.3 (repo-pinned) check + format clean on both touched files.
- Stacked on #76486/#76486-era task-sdk work in spirit (same export-surface
class) but independent of those branches.
---
_AI usage disclosure: found, implemented and verified with AI assistance
under the contributor's direction; the contributor reviewed the diff line by
line. Local Windows checkout cannot materialize the monorepo symlinks, so the
pytest run executes in CI (the same path the existing test_deprecated_exception
uses)._
--
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]