diff --git a/sdk/python/feast/infra/utils/snowflake_utils.py b/sdk/python/feast/infra/utils/snowflake_utils.py index f280cfa218..0e704a385c 100644 --- a/sdk/python/feast/infra/utils/snowflake_utils.py +++ b/sdk/python/feast/infra/utils/snowflake_utils.py @@ -7,9 +7,6 @@ from typing import Dict, Iterator, List, Optional, Tuple, cast import pandas as pd -import snowflake.connector -from snowflake.connector import ProgrammingError, SnowflakeConnection -from snowflake.connector.cursor import SnowflakeCursor from tenacity import ( retry, retry_if_exception_type, @@ -19,6 +16,16 @@ from feast.errors import SnowflakeIncompleteConfig, SnowflakeQueryUnknownError +try: + import snowflake.connector + from snowflake.connector import ProgrammingError, SnowflakeConnection + from snowflake.connector.cursor import SnowflakeCursor +except ImportError as e: + from feast.errors import FeastExtrasDependencyImportError + + raise FeastExtrasDependencyImportError("snowflake", str(e)) + + getLogger("snowflake.connector.cursor").disabled = True getLogger("snowflake.connector.connection").disabled = True getLogger("snowflake.connector.network").disabled = True