From 1ba94f7e2018fea0114f1703dd3942d589071825 Mon Sep 17 00:00:00 2001 From: Aloysius Lim Date: Wed, 2 Oct 2024 23:58:35 +0800 Subject: [PATCH] fix: FeastExtrasDependencyImportError when using SparkOfflineStore without S3 (#4594) * Import aws_utils only if using s3. Signed-off-by: Aloysius Lim * Lint. Signed-off-by: Aloysius Lim --------- Signed-off-by: Aloysius Lim --- .../infra/offline_stores/contrib/spark_offline_store/spark.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py index 2896d565d3..b462607ae1 100644 --- a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py +++ b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py @@ -30,7 +30,6 @@ RetrievalMetadata, ) from feast.infra.registry.base_registry import BaseRegistry -from feast.infra.utils import aws_utils from feast.repo_config import FeastConfigBaseModel, RepoConfig from feast.saved_dataset import SavedDatasetStorage from feast.type_map import spark_schema_to_np_dtypes @@ -399,6 +398,8 @@ def to_remote_storage(self) -> List[str]: return _list_files_in_folder(output_uri) elif self._config.offline_store.staging_location.startswith("s3://"): + from feast.infra.utils import aws_utils + spark_compatible_s3_staging_location = ( self._config.offline_store.staging_location.replace( "s3://", "s3a://"