Skip to content

Commit 0baeeb5

Browse files
authored
fix: Using repo_config parameter in teardown to allow for feature-store-yaml overrides (feast-dev#4413)
* fix: using repo_config parameter in teardown to allow for feature-store-yaml overrides Signed-off-by: Dan Baron <dan.baron@starlingbank.com> * fix: fixing linting and formatting issues in tests Signed-off-by: Dan Baron <dan.baron@starlingbank.com> * fix: removing unnecessary Path object construction Signed-off-by: Dan Baron <dan.baron@starlingbank.com> --------- Signed-off-by: Dan Baron <dan.baron@starlingbank.com>
1 parent 721ec74 commit 0baeeb5

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

sdk/python/feast/repo_operations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def apply_total(repo_config: RepoConfig, repo_path: Path, skip_source_validation
359359

360360
def teardown(repo_config: RepoConfig, repo_path: Optional[str]):
361361
# Cannot pass in both repo_path and repo_config to FeatureStore.
362-
feature_store = FeatureStore(repo_path=repo_path, config=None)
362+
feature_store = FeatureStore(repo_path=repo_path, config=repo_config)
363363
feature_store.teardown()
364364

365365

sdk/python/feast/transformation/pandas_transformation.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from types import FunctionType
2-
from typing import Any
1+
from typing import Any, Callable
32

43
import dill
54
import pandas as pd
@@ -15,7 +14,7 @@
1514

1615

1716
class PandasTransformation:
18-
def __init__(self, udf: FunctionType, udf_string: str = ""):
17+
def __init__(self, udf: Callable[[Any], Any], udf_string: str = ""):
1918
"""
2019
Creates an PandasTransformation object.
2120
@@ -30,11 +29,11 @@ def __init__(self, udf: FunctionType, udf_string: str = ""):
3029
def transform_arrow(
3130
self, pa_table: pyarrow.Table, features: list[Field]
3231
) -> pyarrow.Table:
33-
output_df_pandas = self.udf.__call__(pa_table.to_pandas())
32+
output_df_pandas = self.udf(pa_table.to_pandas())
3433
return pyarrow.Table.from_pandas(output_df_pandas)
3534

3635
def transform(self, input_df: pd.DataFrame) -> pd.DataFrame:
37-
return self.udf.__call__(input_df)
36+
return self.udf(input_df)
3837

3938
def infer_features(self, random_input: dict[str, list[Any]]) -> list[Field]:
4039
df = pd.DataFrame.from_dict(random_input)

sdk/python/tests/integration/feature_repos/universal/data_sources/file.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import tempfile
66
import uuid
77
from pathlib import Path
8+
from subprocess import Popen
89
from typing import Any, Dict, List, Optional
910

1011
import pandas as pd
@@ -367,7 +368,7 @@ class RemoteOfflineStoreDataSourceCreator(FileDataSourceCreator):
367368
def __init__(self, project_name: str, *args, **kwargs):
368369
super().__init__(project_name)
369370
self.server_port: int = 0
370-
self.proc = None
371+
self.proc: Optional[Popen[bytes]] = None
371372

372373
def setup(self, registry: RegistryConfig):
373374
parent_offline_config = super().create_offline_store_config()
@@ -382,13 +383,13 @@ def setup(self, registry: RegistryConfig):
382383
repo_path = Path(tempfile.mkdtemp())
383384
with open(repo_path / "feature_store.yaml", "w") as outfile:
384385
yaml.dump(config.model_dump(by_alias=True), outfile)
385-
repo_path = str(repo_path.resolve())
386+
repo_path = repo_path.resolve()
386387

387388
self.server_port = free_port()
388389
host = "0.0.0.0"
389390
cmd = [
390391
"feast",
391-
"-c" + repo_path,
392+
"-c" + str(repo_path),
392393
"serve_offline",
393394
"--host",
394395
host,

0 commit comments

Comments
 (0)