Filter cross-provider extras in provider docs
This PR fixes an inconsistency between provider documentation generation and provider pyproject.toml generation.
When generating provider pyproject.toml files, cross-provider dependencies are filtered before being added as optional extras: dependencies that are already present in required dependencies, or that belong to suspended providers, are not added as extras.
However, the provider README/index documentation was rendered from the raw cross-providers-deps list. Since cross-providers-deps is an import-level graph, it can include providers that are already required dependencies. This could cause the docs to show invalid provider[extra] installation examples for extras that do not exist in pyproject.toml.
This PR adds get_cross_provider_dependencies_for_extras() and uses it when setting CROSS_PROVIDERS_DEPENDENCIES in the provider Jinja context. The helper applies the same filtering logic used by provider pyproject.toml generation, keeping the generated docs consistent with installable provider extras.
This is my first contribution to Airflow, so feedback is very welcome.
closes: #63891
Tests:
breeze run pytest dev/breeze/tests/test_packages.py::test_get_cross_provider_dependencies_for_extrasprek --files dev/breeze/src/airflow_breeze/utils/packages.py dev/breeze/tests/test_packages.py
Was generative AI tooling used to co-author this PR?
- [x] Yes (please specify the tool below)
Generated-by: Claude following the guidelines
- Read the 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) is needed.
- When adding dependency, check compliance with the ASF 3rd Party License Policy.
- For significant user-facing changes create newsfragment:
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide Here are some useful points:
- Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
- In case of a new feature add useful documentation (in docstrings or in
docs/directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it. - Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the Airflow Coding style.
- Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits. Apache Airflow is a community-driven project and together we are making it better 🚀. In case of doubts contact the developers at: Mailing List: [email protected] Slack: https://s.apache.org/airflow-slack
I updated all the docs by --reapply-templates-only as #63906 mentioned to pass the check.
But there is a check that failed:
When common.compat changes with other providers in the same PR, add '# use next version' comment where they depend on common-compat.
Example: "apache-airflow-providers-common-compat>=1.8.0", # use next version
To bypass this check, add the label: 'skip common compat check'
I think this is because the docs in common-compat are updated, and it is okay to bypass the check. I do not have permission to add the label. Please help. Thanks!
One minor point to fix, this looks good to me otherwise.
I have fixed the package name matching method, but some of the tests failed. I'm trying to track the issue, and I don't think these failures are related to this PR.
It appears to be due to the Airbyte provider compatibility test: they recently released a new version, which might be the main problem causing these failures. This PR only changes the Breeze/docs generation logic and regenerates provider docs, so I don’t think these Airbyte compatibility failures are related to this PR.
I’ll avoid expanding the discussion of this compatibility issue here. If the failure persists, I can open a separate issue to track it.
I’ll avoid expanding the discussion of this compatibility issue here. If the failure persists, I can open a separate issue to track it.
Please feel free to raise a PR to address it if you already got ideas in mind, no need to create an issue for it. #69075 encountered the same regression, and no one had raised PR yet. Thanks.
I've already raised a PR here #69081 :)
I've already raised a PR here #69081 :)
Thanks @shahar1, perfect timing! Will rebase once that lands.
All CI passed. Waiting for approval!
NICE!