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

Method __init__

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

Create the Registry object. Args: registry_config: RegistryConfig object containing the destination path and cache ttl, repo_path: Path to the base of the Feast repository or where it will be created if it does not exist yet.

(
        self,
        project: str,
        registry_config: Optional[RegistryConfig],
        repo_path: Optional[Path],
        auth_config: AuthConfig = NoAuthConfig(),
    )

Source from the content-addressed store, hash-verified

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
225 registry_proto = RegistryProto()
226 registry_proto.registry_schema_version = REGISTRY_SCHEMA_VERSION
227 self.cached_registry_proto = registry_proto
228 self.cached_registry_proto_created = _utc_now()
229
230 self.purge_feast_metadata = (
231 registry_config.purge_feast_metadata
232 if registry_config is not None
233 else False
234 )
235
236 self.enable_online_versioning = (
237 registry_config.enable_online_feature_view_versioning
238 if registry_config is not None
239 else False
240 )
241
242 self.cache_mode = (
243 registry_config.cache_mode if registry_config is not None else "sync"
244 )
245
246 self._file_mtime = None
247 self._file_path = None
248
249 if registry_config:
250 registry_store_type = registry_config.registry_store_type
251 registry_path = registry_config.path
252 if registry_store_type is None:
253 cls = get_registry_store_class_from_scheme(registry_path)
254 else:
255 cls = get_registry_store_class_from_type(str(registry_store_type))
256
257 self._registry_store = cls(registry_config, repo_path)
258 self.cached_registry_proto_ttl = timedelta(
259 seconds=(
260 registry_config.cache_ttl_seconds
261 if registry_config.cache_ttl_seconds is not None
262 else 0
263 )

Callers

nothing calls this directly

Calls 7

commitMethod · 0.95
NoAuthConfigClass · 0.90
_utc_nowFunction · 0.90
get_registry_protoMethod · 0.45

Tested by

no test coverage detected