Revert Cassandra docs to upstream WhiteListRoundRobinPolicy class name#68920
Open
XD-DENG wants to merge 1 commit into
Open
Revert Cassandra docs to upstream WhiteListRoundRobinPolicy class name#68920XD-DENG wants to merge 1 commit into
XD-DENG wants to merge 1 commit into
Conversation
The cassandra-driver library defines the class as `cassandra.policies.WhiteListRoundRobinPolicy`; it does not export an `AllowListRoundRobinPolicy` (no class, no alias). The Cassandra hook correctly imports and matches on `WhiteListRoundRobinPolicy`. In apache#46171 the docs were rewritten to say `AllowListRoundRobinPolicy` to satisfy the `check-for-inclusive-language` pre-commit. The hook code was not changed (it could not be — the upstream class name is fixed), so any user following the docs and supplying `"load_balancing_policy": "AllowListRoundRobinPolicy"` in their connection extras silently fell through to `RoundRobinPolicy()`, with no warning. This restores the docs to the actual upstream class name and adds the docs file to the inclusive-language exclude list, mirroring the existing exemption for the hook source file. The class name is upstream's API surface, not Airflow's to rename.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Cassandra connection docs reference
AllowListRoundRobinPolicy, which does not exist incassandra-driver— the actual class iscassandra.policies.WhiteListRoundRobinPolicy. The hook matches only on the real name, so users following the docs silently fall through toRoundRobinPolicy()inCassandraHook.get_lb_policy: they believe their cluster is restricted to an allowlist of hosts; it isn't.Origin
Introduced in #46171 ("Moved Apache/Cassandra provider to new structure"), where the
check-for-inclusive-languagepre-commit rewroteWhiteList...→AllowList...in the docs. The hook source was already in the inclusive-languageexclude:list, so its references were left intact — but the docs file wasn't, so the rename ended up referring to a class that doesn't exist upstream.Changes
providers/apache/cassandra/docs/connections/cassandra.rst— restoreWhiteListRoundRobinPolicy(3 substitutions)..pre-commit-config.yaml— add the docs file to thecheck-for-inclusive-languageexclude:list, mirroring the existing exemption for the hook source.