Skip to content

Commit

Permalink
updated feature server
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Arceo <[email protected]>
  • Loading branch information
franciscojavierarceo committed Feb 3, 2025
1 parent 3cb6803 commit 889362b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions sdk/python/feast/feature_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,9 @@ class GetOnlineFeaturesRequest(BaseModel):
feature_service: Optional[str] = None
features: Optional[List[str]] = None
full_feature_names: bool = False

class RetrieveOnlineDocumentsRequest(BaseModel):
entities: Dict[str, List[Any]]
feature_service: Optional[str] = None
features: Optional[List[str]] = None
full_feature_names: bool = False
query_embedding: Optional[List[float]] = None


def _get_features(request: GetOnlineFeaturesRequest, store: "feast.FeatureStore"):
if request.feature_service:
feature_service = store.get_feature_service(
Expand Down Expand Up @@ -110,7 +105,6 @@ def _get_features(request: GetOnlineFeaturesRequest, store: "feast.FeatureStore"
resource=od_feature_view, actions=[AuthzedAction.READ_ONLINE]
)
features = request.features # type: ignore

return features


Expand Down Expand Up @@ -187,8 +181,12 @@ async def get_online_features(request: GetOnlineFeaturesRequest) -> Dict[str, An
"/retrieve-online-documents",
dependencies=[Depends(inject_user_details)],
)
async def retrieve_online_documents(request: RetrieveOnlineDocumentsRequest) -> Dict[str, Any]:
logger.warn("This endpoint is in alpha and will be moved to /get-online-features when stable.")
async def retrieve_online_documents(
request: GetOnlineFeaturesRequest,
) -> Dict[str, Any]:
logger.warn(
"This endpoint is in alpha and will be moved to /get-online-features when stable."
)
# Initialize parameters for FeatureStore.retrieve_online_documents_v2(...) call
features = await run_in_threadpool(_get_features, request, store)

Expand Down

0 comments on commit 889362b

Please sign in to comment.