Skip to content

Commit aa7b2a6

Browse files
committed
feat: Add demo noteboooks for users
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
1 parent bedc0ef commit aa7b2a6

4 files changed

Lines changed: 1240 additions & 0 deletions

File tree

sdk/python/feast/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from importlib.metadata import PackageNotFoundError
22
from importlib.metadata import version as _version
33

4+
from feast.demos import copy_demo_notebooks
45
from feast.infra.offline_stores.bigquery_source import BigQuerySource
56
from feast.infra.offline_stores.contrib.athena_offline_store.athena_source import (
67
AthenaSource,
@@ -41,6 +42,7 @@
4142
__all__ = [
4243
"Aggregation",
4344
"BatchFeatureView",
45+
"copy_demo_notebooks",
4446
"DataFrameEngine",
4547
"Entity",
4648
"KafkaSource",

sdk/python/feast/cli/cli.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,39 @@ def validate(
598598
exit(1)
599599

600600

601+
@cli.command("demo-notebooks")
602+
@click.option(
603+
"--output-dir",
604+
"-o",
605+
default="./feast-demo-notebooks",
606+
show_default=True,
607+
help="Directory where the demo notebooks are written.",
608+
)
609+
@click.option(
610+
"--overwrite",
611+
is_flag=True,
612+
default=False,
613+
help="Overwrite existing notebooks if the output directory already exists.",
614+
)
615+
@click.pass_context
616+
def demo_notebooks_command(ctx: click.Context, output_dir: str, overwrite: bool):
617+
"""
618+
Generate demo Jupyter notebooks tailored to the feature store configuration.
619+
620+
Searches the current directory and feast-config/ subdirectory for
621+
feature_store.yaml files. For each project found, a sub-directory is created
622+
under OUTPUT_DIR.
623+
"""
624+
from feast.demos import copy_demo_notebooks
625+
626+
repo = ctx.obj["CHDIR"]
627+
copy_demo_notebooks(
628+
output_dir=output_dir,
629+
repo_path=str(repo),
630+
overwrite=overwrite,
631+
)
632+
633+
601634
cli.add_command(data_sources_cmd)
602635
cli.add_command(entities_cmd)
603636
cli.add_command(feature_services_cmd)

0 commit comments

Comments
 (0)