Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Local staging location provision #3195

Merged
merged 3 commits into from Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -15,7 +15,6 @@
from pyspark import SparkConf
from pyspark.sql import SparkSession
from pytz import utc
from sdk.python.feast.infra.utils import aws_utils

from feast import FeatureView, OnDemandFeatureView
from feast.data_source import DataSource
Expand All @@ -32,6 +31,7 @@
RetrievalMetadata,
)
from feast.infra.registry.registry import Registry
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
Expand Down Expand Up @@ -368,7 +368,7 @@ def to_remote_storage(self) -> List[str]:

sdf: pyspark.sql.DataFrame = self.to_spark_df()

if self._config.offline_store.staging_location.startswith("file://"):
if self._config.offline_store.staging_location.startswith("/"):
local_file_staging_location = os.path.abspath(
self._config.offline_store.staging_location
)
Expand Down
Expand Up @@ -58,8 +58,8 @@ def create_offline_store_config(self):
self.spark_offline_store_config = SparkOfflineStoreConfig()
self.spark_offline_store_config.type = "spark"
self.spark_offline_store_config.spark_conf = self.spark_conf
self.spark_offline_store_config.staging_location = "file://" + str(
tempfile.TemporaryDirectory()
self.spark_offline_store_config.staging_location = (
tempfile.TemporaryDirectory().name
)
self.spark_offline_store_config.region = "eu-west-1"
return self.spark_offline_store_config
Expand Down