Skip to content
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.

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

Add materialize-incremental cli command #1442

Merged
merged 1 commit into from
Apr 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
tsotnet marked this conversation as resolved.
Show resolved Hide resolved
)
@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