MCPcopy Index your code
hub / github.com/feast-dev/feast / bootstrap

Function bootstrap

sdk/python/feast/templates/hbase/bootstrap.py:4–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3
4def bootstrap():
5 # Bootstrap() will automatically be called from the init_repo() during `feast init`
6
7 import pathlib
8 from datetime import datetime, timedelta
9
10 from feast.driver_test_data import create_driver_hourly_stats_df
11
12 repo_path = pathlib.Path(__file__).parent.absolute() / "feature_repo"
13 data_path = repo_path / "data"
14 data_path.mkdir(exist_ok=True)
15
16 end_date = datetime.now().replace(microsecond=0, second=0, minute=0)
17 start_date = end_date - timedelta(days=15)
18
19 driver_entities = [1001, 1002, 1003, 1004, 1005]
20 driver_df = create_driver_hourly_stats_df(driver_entities, start_date, end_date)
21
22 driver_stats_path = data_path / "driver_stats.parquet"
23 driver_df.to_parquet(path=str(driver_stats_path), allow_truncated_timestamps=True)
24
25 example_py_file = repo_path / "feature_definitions.py"
26 replace_str_in_file(
27 example_py_file, "%PARQUET_PATH%", str(driver_stats_path.relative_to(repo_path))
28 )
29
30
31if __name__ == "__main__":

Callers 1

bootstrap.pyFile · 0.70

Calls 2

replace_str_in_fileFunction · 0.90

Tested by

no test coverage detected