Skip to content

Commit

Permalink
Add materialize-incremental cli command (#1442)
Browse files Browse the repository at this point in the history
Signed-off-by: Tsotne Tabidze <[email protected]>
  • Loading branch information
Tsotne Tabidze authored Apr 8, 2021
1 parent 2815c66 commit 6ad9a5b
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion sdk/python/feast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def materialize_command(start_ts: str, end_ts: str, repo_path: str, views: List[
"""
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 registred Feature
online store. If you don't specify feature view names using --views, all registered Feature
Views will be materialized.
START_TS and END_TS should be in ISO 8601 format, e.g. '2021-07-16T19:20:01'
Expand All @@ -429,6 +429,30 @@ def materialize_command(start_ts: str, end_ts: str, repo_path: str, views: List[
)


@cli.command("materialize-incremental")
@click.argument("end_ts")
@click.argument(
"repo_path", type=click.Path(dir_okay=True, exists=True,), default=Path.cwd
)
@click.option(
"--views", "-v", help="Feature views to incrementally materialize", multiple=True,
)
def materialize_incremental_command(end_ts: str, repo_path: str, views: List[str]):
"""
Run an incremental materialization job to ingest new data into the online store. Feast will read
all data from the previously ingested point to 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 incrementally materialized.
END_TS should be in ISO 8601 format, e.g. '2021-07-16T19:20:01'
"""
store = FeatureStore(repo_path=repo_path)
store.materialize_incremental(
feature_views=None if not views else views,
end_date=datetime.fromisoformat(end_ts),
)


@cli.command("init")
@click.option("--minimal", "-m", is_flag=True, help="Only generate the config")
def init_command(minimal: bool):
Expand Down

0 comments on commit 6ad9a5b

Please sign in to comment.