Return the code cell that applies (local) or refreshes (remote) the registry.
(info: dict[str, Any])
| 189 | |
| 190 | |
| 191 | def _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 | |
| 214 | def _path_setup_cell(yaml_abs: str) -> dict[str, Any]: |