Skip to content

Commit 4301991

Browse files
committed
Avoid warnings about unspecified load balancing policy when connecting to a cloud cluster
1 parent f088353 commit 4301991

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ Features
1111
* Handle prepared id mismatch when repreparing on the fly (PYTHON-1124)
1212
* Remove *read_repair_chance table options (PYTHON-1140)
1313
* Flexible version parsing (PYTHON-1174)
14-
* [GRAPH] Ability to execute Fluent Graph queries asynchronously (PYTHON-1129)
1514
* Support NULL in collection deserializer (PYTHON-1123)
15+
* Avoid warnings about unspecified load balancing policy when connecting to a cloud cluster (PYTHON-1177)
16+
* [GRAPH] Ability to execute Fluent Graph queries asynchronously (PYTHON-1129)
1617
1718
Bug Fixes
1819
---------

cassandra/cluster.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,7 @@ def __init__(self,
11061106
self.connection_class = connection_class
11071107

11081108
if cloud is not None:
1109+
self.cloud = cloud
11091110
if contact_points is not _NOT_SET or endpoint_factory or ssl_context or ssl_options:
11101111
raise ValueError("contact_points, endpoint_factory, ssl_context, and ssl_options "
11111112
"cannot be specified with a cloud configuration")
@@ -1242,7 +1243,7 @@ def __init__(self,
12421243
profiles.setdefault(EXEC_PROFILE_GRAPH_ANALYTICS_DEFAULT,
12431244
GraphAnalyticsExecutionProfile(load_balancing_policy=lbp))
12441245

1245-
if self._contact_points_explicit:
1246+
if self._contact_points_explicit and not self.cloud: # avoid this warning for cloud users.
12461247
if self._config_mode is _ConfigMode.PROFILES:
12471248
default_lbp_profiles = self.profile_manager._profiles_without_explicit_lbps()
12481249
if default_lbp_profiles:

0 commit comments

Comments
 (0)