MCPcopy Create free account
hub / github.com/feast-dev/feast / bootstrap

Function bootstrap

sdk/python/feast/templates/ray_rag/bootstrap.py:10–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9
10def bootstrap():
11 repo_path = pathlib.Path(__file__).parent.absolute() / "feature_repo"
12 project_name = pathlib.Path(__file__).parent.absolute().name
13 data_path = repo_path / "data"
14 data_path.mkdir(exist_ok=True)
15
16 print(" 🎬 Setting up sample IMDB movie data for RAG demonstration...")
17
18 parquet_file = data_path / "raw_movies.parquet"
19
20 if parquet_file.exists():
21 try:
22 df = pd.read_parquet(parquet_file)
23 print(f" ✅ Sample dataset ready with {len(df)} movies")
24 print(" 💡 For full dataset (48K+ movies), see README.md")
25 except Exception as e:
26 print(f" ⚠️ Could not read sample dataset: {e}")
27 else:
28 print(" ⚠️ Sample dataset not found, creating minimal example...")
29 sample_data = pd.DataFrame(
30 {
31 "id": ["tt0111161", "tt0068646", "tt0468569", "tt0071562", "tt0050083"],
32 "Name": [
33 "The Shawshank Redemption",
34 "The Godfather",
35 "The Dark Knight",
36 "The Godfather Part II",
37 "12 Angry Men",
38 ],
39 "Description": [
40 "Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.",
41 "The aging patriarch of an organized crime dynasty transfers control of his clandestine empire to his reluctant son.",
42 "When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must accept one of the greatest psychological and physical tests.",
43 "The early life and career of Vito Corleone in 1920s New York City is portrayed, while his son, Michael, expands and tightens his grip on the family crime syndicate.",
44 "A jury holdout attempts to prevent a miscarriage of justice by forcing his colleagues to reconsider the evidence.",
45 ],
46 "Director": [
47 "Frank Darabont",
48 "Francis Ford Coppola",
49 "Christopher Nolan",
50 "Francis Ford Coppola",
51 "Sidney Lumet",
52 ],
53 "Genres": [
54 "Drama",
55 "Crime, Drama",
56 "Action, Crime, Drama",
57 "Crime, Drama",
58 "Crime, Drama",
59 ],
60 "RatingValue": [9.3, 9.2, 9.0, 9.0, 9.0],
61 "DatePublished": pd.to_datetime(
62 [
63 "1994-09-23",
64 "1972-03-24",
65 "2008-07-18",
66 "1974-12-20",
67 "1957-04-10",

Callers 1

bootstrap.pyFile · 0.70

Calls 4

replace_str_in_fileFunction · 0.90
write_tableMethod · 0.80
read_parquetMethod · 0.45
from_pandasMethod · 0.45

Tested by

no test coverage detected