shahar1 opened a new pull request, #76733: URL: https://github.com/apache/airflow/pull/76733
Adds a static check so a provider class that core deprecation shims still re-export cannot be removed by accident, as #76131 did. Split out of #76692. Stacked on the revert of #76131, which is the previous PR in this stack. related: #76568 * New prek hook `check-core-shim-targets-exist`. It reads every `add_deprecated_classes` map in `airflow-core` and fails when an `airflow.providers.*` target no longer exists in the provider sources. It parses the files and imports nothing, and ignores names bound only under `TYPE_CHECKING`. It covers all providers that core shims point at, not only standard. It runs on every change, so deleting a provider module alone cannot skip it. * The targets are recorded in `scripts/ci/prek/core_shim_provider_targets.txt`, seeded from `main` and every released 3.x core. Every provider target of a shim on `main` must be listed there, and every listed target must exist. Removing a class together with its core shim entry, as #76131 did, now fails too, unless the list is edited on purpose. A line may be removed only once the provider requires an Airflow version above every core that still ships the shim, for example once the provider's floor reaches Airflow 4. * The `TimeDeltaSensorAsync` warning now says the class will be removed once the provider requires Airflow 4, instead of "in a future version". The `TODO: Remove in the next major release` comment is gone, since a provider major is not the right trigger. * `AirflowProviderDeprecationWarning` is kept rather than `RemovedInAirflow4Warning`, because the standard provider still supports Airflow 2.11, which has no such class. Checks run locally: * `uv run --project scripts python scripts/ci/prek/check_core_shim_targets_exist.py`: passes. * `uv run --project scripts pytest scripts/tests/ci/prek/test_check_core_shim_targets_exist.py`: 24 passed. * `uv run --project providers/standard pytest providers/standard/tests/unit/standard/sensors/test_time_delta.py`: 19 passed. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Fable 5.1) Generated-by: Claude Code (Fable 5.1) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
