diff --git a/dataprofiler/__init__.py b/dataprofiler/__init__.py index 8249024e..2e89d3e2 100644 --- a/dataprofiler/__init__.py +++ b/dataprofiler/__init__.py @@ -1,6 +1,4 @@ """Package for dataprofiler.""" -import snappy - from . import settings from .data_readers.data import Data from .dp_logging import get_logger, set_verbosity @@ -22,6 +20,22 @@ from .validators.base_validators import Validator from .version import __version__ +try: + import snappy +except ImportError: + import warnings + + warnings.warn( + "Snappy must be installed to use parquet/avro datasets." + "\n\n" + "For macOS use Homebrew:\n" + "\t`brew install snappy`" + "\n\n" + "For linux use apt-get:\n`" + "\tsudo apt-get -y install libsnappy-dev`\n", + ImportWarning, + ) + def set_seed(seed=None): # also check it's an integer