-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from yummyml/fetch_all_entities
add select_all, yummy provider and registry
- Loading branch information
Showing
11 changed files
with
199 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from feast.infra.local import LocalProvider | ||
from feast.repo_config import RepoConfig | ||
from feast.infra.offline_stores.offline_utils import get_offline_store_from_config | ||
from yummy import YummyOfflineStoreConfig | ||
|
||
class YummyProvider(LocalProvider): | ||
|
||
def __init__(self, config: RepoConfig): | ||
super().__init__(config) | ||
|
||
if hasattr(config, "backend"): | ||
config.offline_store.backend=config.backend | ||
|
||
if hasattr(config, "backend_config"): | ||
config.offline_store.config=config.backend_config | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import uuid | ||
import os | ||
from datetime import datetime | ||
from pathlib import Path | ||
|
||
from feast.registry_store import RegistryStore | ||
from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto | ||
from feast.repo_config import RegistryConfig | ||
from feast.usage import log_exceptions_and_usage | ||
|
||
class YummyRegistryStore(RegistryStore): | ||
def __init__(self, registry_config: RegistryConfig, repo_path: Path): | ||
self._registry: RegistryStore = self._factory(registry_config, repo_path) | ||
|
||
def _factory(self, registry_config: RegistryConfig, repo_path: Path): | ||
path = registry_config.path | ||
|
||
if path.startswith("s3://"): | ||
from feast.infra.aws import S3RegistryStore | ||
if hasattr(registry_config, "endpoint_url"): | ||
os.environ["FEAST_S3_ENDPOINT_URL"]=registry_config.s3_endpoint_override | ||
return S3RegistryStore(registry_config, repo_path) | ||
elif path.startswith("gs://"): | ||
from feast.infra.gcp import GCSRegistryStore | ||
return GCSRegistryStore(registry_config, repo_path) | ||
else: | ||
from feast.infra.local import LocalRegistryStore | ||
return LocalRegistryStore(registry_config, repo_path) | ||
|
||
@log_exceptions_and_usage(registry="local") | ||
def get_registry_proto(self): | ||
return self._registry.get_registry_proto() | ||
|
||
@log_exceptions_and_usage(registry="local") | ||
def update_registry_proto(self, registry_proto: RegistryProto): | ||
self._registry.update_registry_proto(registry_proto) | ||
|
||
def teardown(self): | ||
self._registry.teardown() | ||
|
||
def _write_registry(self, registry_proto: RegistryProto): | ||
self._registry._write_registry(registry_proto) | ||
|