Skip to content

Commit 30ac5ad

Browse files
updated feature server
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent bc7ce08 commit 30ac5ad

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

sdk/python/feast/feature_server.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import time
66
import traceback
77
from contextlib import asynccontextmanager
8+
from datetime import datetime
89
from importlib import resources as importlib_resources
910
from typing import Any, Dict, List, Optional, Union
1011

@@ -76,6 +77,7 @@ class MaterializeRequest(BaseModel):
7677
start_ts: str
7778
end_ts: str
7879
feature_views: Optional[List[str]] = None
80+
disable_event_timestamp: bool = False
7981

8082

8183
class MaterializeIncrementalRequest(BaseModel):
@@ -432,10 +434,21 @@ def materialize(request: MaterializeRequest) -> None:
432434
resource=_get_feast_object(feature_view, True),
433435
actions=[AuthzedAction.WRITE_ONLINE],
434436
)
437+
438+
if request.disable_event_timestamp:
439+
# Query all available data and use current datetime as event timestamp
440+
now = datetime.now()
441+
start_date = datetime(1970, 1, 1) # Beginning of time to capture all historical data
442+
end_date = now
443+
else:
444+
start_date = utils.make_tzaware(parser.parse(request.start_ts))
445+
end_date = utils.make_tzaware(parser.parse(request.end_ts))
446+
435447
store.materialize(
436-
utils.make_tzaware(parser.parse(request.start_ts)),
437-
utils.make_tzaware(parser.parse(request.end_ts)),
448+
start_date,
449+
end_date,
438450
request.feature_views,
451+
disable_event_timestamp=request.disable_event_timestamp,
439452
)
440453

441454
@app.post("/materialize-incremental", dependencies=[Depends(inject_user_details)])

sdk/python/feast/infra/provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def materialize_single_feature_view(
241241
registry: The registry for the current feature store.
242242
project: Feast project to which the objects belong.
243243
tqdm_builder: A function to monitor the progress of materialization.
244-
disable_event_timestamp: If True, uses current datetime for materialization instead of event timestamps.
244+
disable_event_timestamp: If True, materializes all available data using current datetime as event timestamp instead of source event timestamps.
245245
"""
246246
pass
247247

0 commit comments

Comments
 (0)