Skip to content

Commit 5239b6b

Browse files
committed
Make it compression=None a valid case
This regression was cased by 78f5542 And missed during review. compression=None is the same as compression=False, but it is valid now.
1 parent ba3aeaa commit 5239b6b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cassandra/cluster.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ class Cluster(object):
685685
Used for testing new protocol features incrementally before the new version is complete.
686686
"""
687687

688-
compression: Union[bool, str] = True
688+
compression: Union[bool, str, None] = True
689689
"""
690690
Controls compression for communications between the driver and Cassandra.
691691
If left as the default of :const:`True`, either lz4 or snappy compression
@@ -1172,7 +1172,7 @@ def token_metadata_enabled(self, enabled):
11721172
def __init__(self,
11731173
contact_points=_NOT_SET,
11741174
port=9042,
1175-
compression: Union[bool, str] = True,
1175+
compression: Union[bool, str, None] = True,
11761176
auth_provider=None,
11771177
load_balancing_policy=None,
11781178
reconnection_policy=None,
@@ -1285,7 +1285,7 @@ def __init__(self,
12851285

12861286
self._resolve_hostnames()
12871287

1288-
if isinstance(compression, bool):
1288+
if isinstance(compression, bool) or compression is None:
12891289
if compression and not locally_supported_compressions:
12901290
log.error(
12911291
"Compression is enabled, but no compression libraries are available. "

0 commit comments

Comments
 (0)