Skip to content

Commit aa2a86a

Browse files
chore: Add separate go_feature_serving flag (#2968)
Add separate `go_feature_serving` flag to distinguish between Go feature serving and embedded Go code Signed-off-by: Felix Wang <[email protected]>
1 parent a233d3f commit aa2a86a

File tree

8 files changed

+15
-11
lines changed

8 files changed

+15
-11
lines changed

.github/workflows/build_wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,5 +245,5 @@ jobs:
245245
feast apply
246246
echo "$TEST_SCRIPT" > run-and-wait.sh
247247
pip install cffi
248-
printf "\ngo_feature_retrieval: True" >> feature_store.yaml
248+
printf "\ngo_feature_serving: True" >> feature_store.yaml
249249
bash run-and-wait.sh feast serve

sdk/python/feast/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ def serve_command(
668668

669669
if go:
670670
# Turn on Go feature retrieval.
671-
store.config.go_feature_retrieval = True
671+
store.config.go_feature_serving = True
672672

673673
store.serve(host, port, type_, no_access_log, no_feature_log)
674674

sdk/python/feast/feature_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ def _get_online_features(
15641564
for k, v in entity_values.items()
15651565
}
15661566

1567-
# If Go feature server is enabled, send request to it instead of going through regular Python logic
1567+
# If the embedded Go code is enabled, send request to it instead of going through regular Python logic.
15681568
if self.config.go_feature_retrieval:
15691569
self._lazy_init_go_server()
15701570

@@ -2217,7 +2217,7 @@ def serve(
22172217
) -> None:
22182218
"""Start the feature consumption server locally on a given port."""
22192219
type_ = type_.lower()
2220-
if self.config.go_feature_retrieval:
2220+
if self.config.go_feature_serving:
22212221
# Start go server instead of python if the flag is enabled
22222222
self._lazy_init_go_server()
22232223
enable_logging = (

sdk/python/feast/repo_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ class RepoConfig(FeastBaseModel):
139139

140140
repo_path: Optional[Path] = None
141141

142+
go_feature_serving: Optional[bool] = False
143+
""" If True, use the Go feature server instead of the Python feature server. """
144+
142145
go_feature_retrieval: Optional[bool] = False
146+
""" If True, use the embedded Go code to retrieve features instead of the Python SDK. """
143147

144148
entity_key_serialization_version: StrictInt = 1
145149
""" Entity key serialization version: This version is used to control what serialization scheme is

sdk/python/tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def pytest_generate_tests(metafunc: pytest.Metafunc):
268268
)
269269

270270
if "goserver" in markers:
271-
extra_dimensions.append({"go_feature_retrieval": True})
271+
extra_dimensions.append({"go_feature_serving": True})
272272

273273
configs = []
274274
if offline_stores:
@@ -283,7 +283,7 @@ def pytest_generate_tests(metafunc: pytest.Metafunc):
283283
**dim,
284284
}
285285
# temporary Go works only with redis
286-
if config.get("go_feature_retrieval") and (
286+
if config.get("go_feature_serving") and (
287287
not isinstance(online_store, dict)
288288
or online_store["type"] != "redis"
289289
):

sdk/python/tests/integration/e2e/test_go_feature_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def initialized_registry(environment, universal_data_sources):
5959

6060

6161
def server_port(environment, server_type: str):
62-
if not environment.test_repo_config.go_feature_retrieval:
62+
if not environment.test_repo_config.go_feature_serving:
6363
pytest.skip("Only for Go path")
6464

6565
fs = environment.feature_store

sdk/python/tests/integration/feature_repos/integration_test_repo_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class IntegrationTestRepoConfig:
3737
full_feature_names: bool = True
3838
infer_features: bool = False
3939
python_feature_server: bool = False
40-
go_feature_retrieval: bool = False
40+
go_feature_serving: bool = False
4141

4242
def __repr__(self) -> str:
4343
if not self.online_store_creator:
@@ -61,7 +61,7 @@ def __repr__(self) -> str:
6161
f"{self.offline_store_creator.__name__.split('.')[-1].replace('DataSourceCreator', '')}",
6262
online_store_type,
6363
f"python_fs:{self.python_feature_server}",
64-
f"go_fs:{self.go_feature_retrieval}",
64+
f"go_fs:{self.go_feature_serving}",
6565
]
6666
)
6767

@@ -77,6 +77,6 @@ def __eq__(self, other):
7777
and self.online_store == other.online_store
7878
and self.offline_store_creator == other.offline_store_creator
7979
and self.online_store_creator == other.online_store_creator
80-
and self.go_feature_retrieval == other.go_feature_retrieval
80+
and self.go_feature_serving == other.go_feature_serving
8181
and self.python_feature_server == other.python_feature_server
8282
)

sdk/python/tests/integration/feature_repos/repo_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def construct_test_environment(
420420
batch_engine=test_repo_config.batch_engine,
421421
repo_path=repo_dir_name,
422422
feature_server=feature_server,
423-
go_feature_retrieval=test_repo_config.go_feature_retrieval,
423+
go_feature_serving=test_repo_config.go_feature_serving,
424424
)
425425

426426
# Create feature_store.yaml out of the config

0 commit comments

Comments
 (0)