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

Function _apply_code

sdk/python/feast/demos.py:191–211  ·  view source on GitHub ↗

Return the code cell that applies (local) or refreshes (remote) the registry.

(info: dict[str, Any])

Source from the content-addressed store, hash-verified

189
190
191def _apply_code(info: dict[str, Any]) -> dict[str, Any]:
192 """Return the code cell that applies (local) or refreshes (remote) the registry."""
193 if info["registry_type"] == "remote":
194 return _code(
195 "store.refresh_registry()\n"
196 "fvs = store.list_feature_views()\n"
197 "print(f'Registry synced — {len(fvs)} feature view(s) available.')"
198 )
199 # Local file registry — auto-apply if empty, then refresh.
200 return _code(
201 "fvs = store.list_feature_views()\n"
202 "entities = store.list_entities()\n"
203 "\n"
204 "if fvs or entities:\n"
205 " print(f'Registry ready: {len(entities)} entity/entities, {len(fvs)} feature view(s)')\n"
206 "else:\n"
207 " print('Registry is empty — running feast apply ...')\n"
208 " !feast -f {FEAST_FS_YAML} apply\n"
209 " store.refresh_registry()\n"
210 " print('Apply complete.')"
211 )
212
213
214def _path_setup_cell(yaml_abs: str) -> dict[str, Any]:

Callers 1

_nb_overviewFunction · 0.85

Calls 1

_codeFunction · 0.85

Tested by

no test coverage detected