Skip to content

Revert Cassandra docs to upstream WhiteListRoundRobinPolicy class name#68920

Open
XD-DENG wants to merge 1 commit into
apache:mainfrom
XD-DENG:fix-cassandra-allowlist-docs
Open

Revert Cassandra docs to upstream WhiteListRoundRobinPolicy class name#68920
XD-DENG wants to merge 1 commit into
apache:mainfrom
XD-DENG:fix-cassandra-allowlist-docs

Conversation

@XD-DENG

@XD-DENG XD-DENG commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

The Cassandra connection docs reference AllowListRoundRobinPolicy, which does not exist in cassandra-driver — the actual class is cassandra.policies.WhiteListRoundRobinPolicy. The hook matches only on the real name, so users following the docs silently fall through to RoundRobinPolicy() in CassandraHook.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-language pre-commit rewrote WhiteList...AllowList... in the docs. The hook source was already in the inclusive-language exclude: 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 — restore WhiteListRoundRobinPolicy (3 substitutions).
  • .pre-commit-config.yaml — add the docs file to the check-for-inclusive-language exclude: list, mirroring the existing exemption for the hook source.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant