XD-DENG opened a new pull request, #68920:
URL: https://github.com/apache/airflow/pull/68920

   ## Summary
   
   The Cassandra connection docs reference an `AllowListRoundRobinPolicy` that 
does not exist in `cassandra-driver`. The actual upstream class is 
`cassandra.policies.WhiteListRoundRobinPolicy`, with no 
`AllowListRoundRobinPolicy` class or alias. The hook 
(`providers/apache/cassandra/.../hooks/cassandra.py`) correctly imports and 
matches on the real class name; only the docs were wrong.
   
   Anyone following the docs and supplying `"load_balancing_policy": 
"AllowListRoundRobinPolicy"` in their connection extras silently falls through 
to `RoundRobinPolicy()` in `CassandraHook.get_lb_policy` — no error, no 
warning. They believe their cluster is restricted to an allowlist of hosts; it 
is not. This is a real correctness/security issue: traffic flows to all 
reachable hosts in the cluster.
   
   ## Origin
   
   The bug was introduced by #46171 ("Moved Apache/Cassandra provider to new 
structure", 2025-01-30), whose description states *"Moved apache/cassandra and 
fixed check-for-inclusive-language"*. The `check-for-inclusive-language` 
pre-commit hook flagged the existing `WhiteList...` strings in the docs and 
they were rewritten to `AllowList...`. The hook source file already had a 
per-file exemption in the inclusive-language `exclude:` list, so its 
`WhiteListRoundRobinPolicy` references were untouched — the rename never 
propagated to the only place that mattered. The docs file was not in the 
exclude list, so it was rewritten to a name that does not exist upstream.
   
   ## Changes
   
   - `providers/apache/cassandra/docs/connections/cassandra.rst` — three 
substitutions, restoring `WhiteListRoundRobinPolicy` to match the actual 
cassandra-driver class name.
   - `.pre-commit-config.yaml` — add the docs file to the 
`check-for-inclusive-language` `exclude:` list, mirroring the existing 
exemption for `providers/apache/cassandra/.../hooks/cassandra.py`. The class 
name is upstream's API surface and is not Airflow's to rename.
   
   ## Test plan
   
   - [x] Local regex check (equivalent of `check-for-inclusive-language`) 
confirms both edited files are covered by the exclude list.
   - [x] Verified upstream `datastax/python-driver/cassandra/policies.py` 
defines only `class WhiteListRoundRobinPolicy(RoundRobinPolicy)` — no 
`AllowListRoundRobinPolicy` class or alias.
   - [ ] CI on this PR runs the full pre-commit suite.


-- 
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]

Reply via email to