MCPcopy
hub / github.com/feast-dev/feast / _extract_store_info

Function _extract_store_info

sdk/python/feast/demos.py:71–111  ·  view source on GitHub ↗

Summarise the key fields from a raw ``feature_store.yaml`` dict.

(config: dict[str, Any])

Source from the content-addressed store, hash-verified

69
70
71def _extract_store_info(config: dict[str, Any]) -> dict[str, Any]:
72 """Summarise the key fields from a raw ``feature_store.yaml`` dict."""
73 info: dict[str, Any] = {
74 "project": config.get("project", "my_feast_project"),
75 "provider": config.get("provider", "local"),
76 "online_store_type": "sqlite",
77 "offline_store_type": "file",
78 "registry_type": "file",
79 "auth_type": "no_auth",
80 "vector_enabled": False,
81 "embedding_dim": None,
82 }
83
84 online = config.get("online_store", {})
85 if isinstance(online, dict):
86 info["online_store_type"] = online.get("type", "sqlite").lower()
87 info["vector_enabled"] = bool(online.get("vector_enabled", False))
88 if online.get("embedding_dim"):
89 info["embedding_dim"] = online["embedding_dim"]
90 elif isinstance(online, str):
91 info["online_store_type"] = online.lower()
92
93 offline = config.get("offline_store", {})
94 if isinstance(offline, dict):
95 info["offline_store_type"] = offline.get("type", "file").lower()
96 elif isinstance(offline, str):
97 info["offline_store_type"] = offline.lower()
98
99 registry = config.get("registry", {})
100 if isinstance(registry, dict):
101 # Operator client YAML uses "registry_type" key; standard Feast uses "type"
102 info["registry_type"] = (
103 registry.get("registry_type") or registry.get("type", "file")
104 ).lower()
105 # string registry value is a plain file path — keep default "file"
106
107 auth = config.get("auth", {})
108 if isinstance(auth, dict):
109 info["auth_type"] = auth.get("type", "no_auth").lower()
110
111 return info
112
113
114# ---------------------------------------------------------------------------

Calls 1

getMethod · 0.80