From 8cb9189c30798f6db84d45f5725c2c45c3cd37b1 Mon Sep 17 00:00:00 2001 From: Xiaodong DENG Date: Tue, 23 Jun 2026 15:46:27 -0700 Subject: [PATCH] Revert Cassandra docs to upstream WhiteListRoundRobinPolicy class name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #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. --- .pre-commit-config.yaml | 1 + providers/apache/cassandra/docs/connections/cassandra.rst | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f3461ed417cd4..df917234f369c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -755,6 +755,7 @@ repos: ^providers/amazon/src/airflow/providers/amazon/aws/operators/emr\.py$| ^providers/.*/get_provider_info\.py$| ^providers/.*/provider\.yaml$| + ^providers/apache/cassandra/docs/connections/cassandra\.rst$| ^providers/apache/cassandra/src/airflow/providers/apache/cassandra/hooks/cassandra\.py$| ^providers/apache/hdfs/docs/connections\.rst$| ^providers/apache/hive/src/airflow/providers/apache/hive/operators/hive_stats\.py$| diff --git a/providers/apache/cassandra/docs/connections/cassandra.rst b/providers/apache/cassandra/docs/connections/cassandra.rst index 54184bf8941df..6903be17f4c50 100644 --- a/providers/apache/cassandra/docs/connections/cassandra.rst +++ b/providers/apache/cassandra/docs/connections/cassandra.rst @@ -50,7 +50,7 @@ Extra (optional) are supported: * ``load_balancing_policy`` - This parameter specifies the load balancing policy to be used. There are four available policies: - ``RoundRobinPolicy``, ``DCAwareRoundRobinPolicy``, ``AllowListRoundRobinPolicy`` and ``TokenAwarePolicy``. ``RoundRobinPolicy`` is the default load balancing policy. + ``RoundRobinPolicy``, ``DCAwareRoundRobinPolicy``, ``WhiteListRoundRobinPolicy`` and ``TokenAwarePolicy``. ``RoundRobinPolicy`` is the default load balancing policy. * ``load_balancing_policy_args`` - This parameter specifies the arguments for the load balancing policy being used. * ``cql_version`` - This parameter specifies the CQL version of cassandra. * ``protocol_version`` - This parameter specifies the maximum version of the native protocol to use. @@ -88,12 +88,12 @@ DCAwareRoundRobinPolicy: } } -AllowListRoundRobinPolicy +WhiteListRoundRobinPolicy .. code-block:: json { - "load_balancing_policy": "AllowListRoundRobinPolicy", + "load_balancing_policy": "WhiteListRoundRobinPolicy", "load_balancing_policy_args": { "hosts": ["HOST1", "HOST2", "HOST3"] }