Skip to content

Commit 21bc5a9

Browse files
author
Bhargav Dodla
committed
fix: Added Project object to template and quick start
Signed-off-by: Bhargav Dodla <bdodla@expediagroup.com>
1 parent c81cebd commit 21bc5a9

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

docs/getting-started/quickstart.md

+5
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,17 @@ from feast import (
103103
FeatureView,
104104
Field,
105105
FileSource,
106+
Project,
106107
PushSource,
107108
RequestSource,
108109
)
109110
from feast.on_demand_feature_view import on_demand_feature_view
110111
from feast.types import Float32, Float64, Int64
111112

113+
# Define a project for the feature repo
114+
project = Project(name="my_project", description="A project for driver statistics")
115+
116+
112117
# Define an entity for the driver. You can think of an entity as a primary key used to
113118
# fetch features.
114119
driver = Entity(name="driver", join_keys=["driver_id"])

sdk/python/feast/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .feature_view import FeatureView
1919
from .field import Field
2020
from .on_demand_feature_view import OnDemandFeatureView
21+
from .project import Project
2122
from .repo_config import RepoConfig
2223
from .stream_feature_view import StreamFeatureView
2324
from .value_type import ValueType
@@ -49,4 +50,5 @@
4950
"PushSource",
5051
"RequestSource",
5152
"AthenaSource",
53+
"Project",
5254
]

sdk/python/feast/templates/local/bootstrap.py

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def bootstrap():
1010
from feast.driver_test_data import create_driver_hourly_stats_df
1111

1212
repo_path = pathlib.Path(__file__).parent.absolute() / "feature_repo"
13+
project_name = pathlib.Path(__file__).parent.absolute().name
1314
data_path = repo_path / "data"
1415
data_path.mkdir(exist_ok=True)
1516

@@ -23,6 +24,7 @@ def bootstrap():
2324
driver_df.to_parquet(path=str(driver_stats_path), allow_truncated_timestamps=True)
2425

2526
example_py_file = repo_path / "example_repo.py"
27+
replace_str_in_file(example_py_file, "%PROJECT_NAME%", str(project_name))
2628
replace_str_in_file(example_py_file, "%PARQUET_PATH%", str(driver_stats_path))
2729
replace_str_in_file(example_py_file, "%LOGGING_PATH%", str(data_path))
2830

sdk/python/feast/templates/local/feature_repo/example_repo.py

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
FeatureView,
1111
Field,
1212
FileSource,
13+
Project,
1314
PushSource,
1415
RequestSource,
1516
)
@@ -18,6 +19,9 @@
1819
from feast.on_demand_feature_view import on_demand_feature_view
1920
from feast.types import Float32, Float64, Int64
2021

22+
# Define a project for the feature repo
23+
project = Project(name="%PROJECT_NAME%", description="A project for driver statistics")
24+
2125
# Define an entity for the driver. You can think of an entity as a primary key used to
2226
# fetch features.
2327
driver = Entity(name="driver", join_keys=["driver_id"])

0 commit comments

Comments
 (0)