Skip to content

Commit 7db823d

Browse files
committed
(improvement) log a warning when importing of lz4 or snappy packages fails.
If it is not available, the driver will silently not use compression. Not very very silently, as you will see in debug level only something like: "No available compression types supported on both ends. locally supported: odict_keys([]). remotely supported: ['lz4', 'snappy']" Make it a warning. I think it wouldn't be too noisy and is clear enough for the developer. Signed-off-by: Yaniv Kaul <[email protected]>
1 parent 472b679 commit 7db823d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cassandra/connection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
try:
6565
import lz4
6666
except ImportError:
67+
log.warning("lz4 package could not be imported. LZ4 Compression will not be available")
6768
pass
6869
else:
6970
# The compress and decompress functions we need were moved from the lz4 to
@@ -102,6 +103,7 @@ def lz4_decompress(byts):
102103
try:
103104
import snappy
104105
except ImportError:
106+
log.warning("snappy package could not be imported. Snappy Compression will not be available")
105107
pass
106108
else:
107109
# work around apparently buggy snappy decompress

0 commit comments

Comments
 (0)