MCPcopy Create free account
hub / github.com/feast-dev/feast / materialize_command

Function materialize_command

sdk/python/feast/cli/cli.py:372–417  ·  view source on GitHub ↗

Run a (non-incremental) materialization job to ingest data into the online store. Feast will read all data between START_TS and END_TS from the offline store and write it to the online store. If you don't specify feature view names using --views, all registered Feature Views will be

(
    ctx: click.Context,
    start_ts: Optional[str],
    end_ts: Optional[str],
    views: List[str],
    disable_event_timestamp: bool,
    feature_view_version: Optional[str],
)

Source from the content-addressed store, hash-verified

370)
371@click.pass_context
372def materialize_command(
373 ctx: click.Context,
374 start_ts: Optional[str],
375 end_ts: Optional[str],
376 views: List[str],
377 disable_event_timestamp: bool,
378 feature_view_version: Optional[str],
379):
380 """
381 Run a (non-incremental) materialization job to ingest data into the online store. Feast
382 will read all data between START_TS and END_TS from the offline store and write it to the
383 online store. If you don't specify feature view names using --views, all registered Feature
384 Views will be materialized.
385
386 START_TS and END_TS should be in ISO 8601 format, e.g. '2021-07-16T19:20:01'
387
388 If --disable-event-timestamp is used, timestamps are not required and all available data will be materialized using the current datetime as the event timestamp.
389 """
390 store = create_feature_store(ctx)
391
392 if disable_event_timestamp:
393 if start_ts or end_ts:
394 raise click.UsageError(
395 "Cannot specify START_TS or END_TS when --disable-event-timestamp is used"
396 )
397 now = datetime.now()
398 # Query all available data and use current datetime as event timestamp
399 start_date = datetime(
400 1970, 1, 1
401 ) # Beginning of time to capture all historical data
402 end_date = now
403 else:
404 if not start_ts or not end_ts:
405 raise click.UsageError(
406 "START_TS and END_TS are required unless --disable-event-timestamp is used"
407 )
408 start_date = utils.make_tzaware(parser.parse(start_ts))
409 end_date = utils.make_tzaware(parser.parse(end_ts))
410
411 store.materialize(
412 feature_views=None if not views else views,
413 start_date=start_date,
414 end_date=end_date,
415 disable_event_timestamp=disable_event_timestamp,
416 version=feature_view_version,
417 )
418
419
420@cli.command("materialize-incremental")

Callers

nothing calls this directly

Calls 3

create_feature_storeFunction · 0.90
parseMethod · 0.80
materializeMethod · 0.45

Tested by

no test coverage detected