GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Implement and enhance remote document retrieval functionality by jyejare · Pull Request #5487 · feast-dev/feast

feat: Implement and enhance remote document retrieval functionality #5487

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.

Sign up for GitHub

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

Merged
franciscojavierarceo merged 6 commits into feast-dev:master from jyejare:remote_retrieve_docs
Jul 28, 2025

Uh oh!

There was an error while loading. Please reload this page.

Merged

feat: Implement and enhance remote document retrieval functionality #5487

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
6 commits
Select commit Hold shift + click to select a range
7c951eb
Remotely retrieve the docs
jyejare Jun 12, 2025
7839fc5
Feature server rectified for documents retrival
jyejare Jun 17, 2025
18bfcf4
Updates to remote retrival for response extraction
jyejare Jun 26, 2025
2043b09
Remote retrive online doc v2
jyejare Jun 26, 2025
8bcb2ae
Unit tests for Remote docuemnts retrival
jyejare Jul 1, 2025
dfafa56
Fixed checks and comments
jyejare Jul 1, 2025
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

41 changes: 27 additions & 14 deletions 41 sdk/python/feast/feature_server.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import traceback
from contextlib import asynccontextmanager
from importlib import resources as importlib_resources
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Optional, Union

import pandas as pd
import psutil
Expand Down Expand Up @@ -86,10 +86,18 @@ class MaterializeIncrementalRequest(BaseModel):
class GetOnlineFeaturesRequest(BaseModel):
entities: Dict[str, List[Any]]
feature_service: Optional[str] = None
features: Optional[List[str]] = None
features: List[str] = []
full_feature_names: bool = False
query_embedding: Optional[List[float]] = None


class GetOnlineDocumentsRequest(BaseModel):
Comment thread
jyejare marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

feature_service: Optional[str] = None
features: List[str] = []
full_feature_names: bool = False
top_k: Optional[int] = None
query: Optional[List[float]] = None
query_string: Optional[str] = None
api_version: Optional[int] = 1


class ChatMessage(BaseModel):
Expand All @@ -110,7 +118,10 @@ class SaveDocumentRequest(BaseModel):
data: dict


def _get_features(request: GetOnlineFeaturesRequest, store: "feast.FeatureStore"):
def _get_features(
request: Union[GetOnlineFeaturesRequest, GetOnlineDocumentsRequest],
store: "feast.FeatureStore",
):
if request.feature_service:
feature_service = store.get_feature_service(
request.feature_service, allow_cache=True
Expand Down Expand Up @@ -246,24 +257,26 @@ async def get_online_features(request: GetOnlineFeaturesRequest) -> Dict[str, An
dependencies=[Depends(inject_user_details)],
)
async def retrieve_online_documents(
request: GetOnlineFeaturesRequest,
request: GetOnlineDocumentsRequest,
) -> Dict[str, Any]:
logger.warning(
"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)

read_params = dict(
features=features,
full_feature_names=request.full_feature_names,
query=request.query_embedding,
query_string=request.query_string,
)
read_params = dict(features=features, query=request.query, top_k=request.top_k)
if request.api_version == 2 and request.query_string is not None:
read_params["query_string"] = request.query_string

response = await run_in_threadpool(
lambda: store.retrieve_online_documents_v2(**read_params) # type: ignore
)
if request.api_version == 2:
Comment thread
jyejare marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

response = await run_in_threadpool(
lambda: store.retrieve_online_documents_v2(**read_params) # type: ignore
)
else:
response = await run_in_threadpool(
lambda: store.retrieve_online_documents(**read_params) # type: ignore
)

# Convert the Protobuf object to JSON and return it
response_dict = await run_in_threadpool(
Expand Down
5 changes: 5 additions & 0 deletions 5 sdk/python/feast/feature_store.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,11 @@ def _retrieve_from_online_store_v2(
output_len=output_len,
)

utils._populate_result_rows_from_columnar(
online_features_response=online_features_response,
data=entity_key_dict,
)

return OnlineResponse(online_features_response)

def serve(
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.