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

Class Registry

sdk/python/feast/infra/registry/registry.py:167–1671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165
166
167class Registry(BaseRegistry):
168 def apply_user_metadata(
169 self,
170 project: str,
171 feature_view: BaseFeatureView,
172 metadata_bytes: Optional[bytes],
173 ):
174 pass
175
176 def get_user_metadata(
177 self, project: str, feature_view: BaseFeatureView
178 ) -> Optional[bytes]:
179 pass
180
181 def set_project_metadata(self, project: str, key: str, value: str):
182 """Set a custom project metadata key-value pair in the registry backend."""
183 if hasattr(self._registry_store, "set_project_metadata"):
184 self._registry_store.set_project_metadata(project, key, value)
185 else:
186 raise NotImplementedError(
187 "set_project_metadata not implemented for this registry backend"
188 )
189
190 def get_project_metadata(self, project: str, key: str) -> Optional[str]:
191 """Get a custom project metadata value by key from the registry backend."""
192 if hasattr(self._registry_store, "get_project_metadata"):
193 return self._registry_store.get_project_metadata(project, key)
194 else:
195 raise NotImplementedError(
196 "get_project_metadata not implemented for this registry backend"
197 )
198
199 # The cached_registry_proto object is used for both reads and writes. In particular,
200 # all write operations refresh the cache and modify it in memory; the write must
201 # then be persisted to the underlying RegistryStore with a call to commit().
202 cached_registry_proto: RegistryProto
203 cached_registry_proto_created: datetime
204 cached_registry_proto_ttl: timedelta
205
206 def __init__(
207 self,
208 project: str,
209 registry_config: Optional[RegistryConfig],
210 repo_path: Optional[Path],
211 auth_config: AuthConfig = NoAuthConfig(),
212 ):
213 """
214 Create the Registry object.
215
216 Args:
217 registry_config: RegistryConfig object containing the destination path and cache ttl,
218 repo_path: Path to the base of the Feast repository
219 or where it will be created if it does not exist yet.
220 """
221
222 self._refresh_lock = Lock()
223 self._auth_config = auth_config
224

Callers 15

_create_registryMethod · 0.90
registry_dumpFunction · 0.90
registryFunction · 0.90
local_registryFunction · 0.90
gcs_registryFunction · 0.90
s3_registryFunction · 0.90
minio_registryFunction · 0.90
hdfs_registryFunction · 0.90
mock_remote_registryFunction · 0.90
test_commitFunction · 0.90

Calls

no outgoing calls

Tested by 15

registryFunction · 0.72
local_registryFunction · 0.72
gcs_registryFunction · 0.72
s3_registryFunction · 0.72
minio_registryFunction · 0.72
hdfs_registryFunction · 0.72
mock_remote_registryFunction · 0.72
test_commitFunction · 0.72
file_registryFunction · 0.72