Skip to content

Commit d2e4b5b

Browse files
committed
fix
1 parent e488d1c commit d2e4b5b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

python/hopsworks/project.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,17 @@ def created(self):
103103
"""Timestamp when the project was created"""
104104
return self._created
105105

106-
def get_feature_store(self, name: str = None) -> feature_store.FeatureStore:
106+
def get_feature_store(self, name: str = None, engine: str = None) -> feature_store.FeatureStore:
107107
"""Connect to Project's Feature Store.
108108
109109
Defaulting to the project name of default feature store. To get a
110110
shared feature store, the project name of the feature store is required.
111111
112112
# Arguments
113113
name: Project name of the feature store.
114+
engine: Which engine to use, `"spark"`, `"python"` or `"training"`.
115+
Defaults to `"python"` when connected to https://c.app.hopsworks.ai/
116+
See hsfs.Connection.connection documentation for more information.
114117
# Returns
115118
`hsfs.feature_store.FeatureStore`: The Feature Store API
116119
# Raises
@@ -120,8 +123,7 @@ def get_feature_store(self, name: str = None) -> feature_store.FeatureStore:
120123

121124
_client = client.get_instance()
122125
if type(_client) == Client: # If external client
123-
engine = None
124-
if _client._host == constants.HOSTS.APP_HOST:
126+
if _client._host == constants.HOSTS.APP_HOST and engine is None:
125127
engine = "python"
126128
return connection(
127129
host=_client._host,
@@ -131,7 +133,7 @@ def get_feature_store(self, name: str = None) -> feature_store.FeatureStore:
131133
engine=engine,
132134
).get_feature_store(name)
133135
else:
134-
return connection().get_feature_store(name) # If internal client
136+
return connection().get_feature_store(name, engine=engine) # If internal client
135137

136138
def get_model_registry(self):
137139
"""Connect to Project's Model Registry API.

0 commit comments

Comments
 (0)