Skip to content

Commit

Permalink
Add warning on compression modules import
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Nov 7, 2024
1 parent 2d5b1aa commit 8a4e7c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clickhouse_driver/compression/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import importlib
import logging

from .. import errors
from ..protocol import CompressionMethodByte

logger = logging.getLogger(__name__)


def get_compressor_cls(alg):
try:
module = importlib.import_module('.' + alg, __name__)
return module.Compressor

except ImportError:
logger.warning('Unable to import module %s', alg, exc_info=True)
raise errors.UnknownCompressionMethod(
"Unknown compression method: '{}'".format(alg)
)
Expand Down

0 comments on commit 8a4e7c5

Please sign in to comment.