From 4437cd2ddb09b0829e50ba97b0a4fdfdd97d5282 Mon Sep 17 00:00:00 2001 From: Aloysius Lim Date: Wed, 2 Oct 2024 09:13:23 +0800 Subject: [PATCH 1/2] Import aws_utils only if using s3. Signed-off-by: Aloysius Lim --- .../infra/offline_stores/contrib/spark_offline_store/spark.py | 4 +++- 1 file changed, 3 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 2896d565d30..fbc935f925e 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,9 @@ 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://" From 0342a6ee8e6fecfc65b22ed09353c27023baac04 Mon Sep 17 00:00:00 2001 From: Aloysius Lim Date: Wed, 2 Oct 2024 09:29:31 +0800 Subject: [PATCH 2/2] Lint. Signed-off-by: Aloysius Lim --- .../infra/offline_stores/contrib/spark_offline_store/spark.py | 1 - 1 file changed, 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 fbc935f925e..b462607ae1e 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 @@ -398,7 +398,6 @@ 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 = (