Skip to content

Commit

Permalink
cache provider in feature store instance (#1924)
Browse files Browse the repository at this point in the history
* cache provider in feature store instance

Signed-off-by: DvirDukhan <dvir@redislabs.com>

* added _provider property to feature store

Signed-off-by: DvirDukhan <dvir@redislabs.com>
  • Loading branch information
DvirDukhan authored Oct 6, 2021
1 parent b1ccf8d commit 7f35793
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class FeatureStore:
config: RepoConfig
repo_path: Path
_registry: Registry
_provider: Provider

@log_exceptions
def __init__(
Expand All @@ -100,6 +101,7 @@ def __init__(

registry_config = self.config.get_registry_config()
self._registry = Registry(registry_config, repo_path=self.repo_path)
self._provider = get_provider(self.config, self.repo_path)

@log_exceptions
def version(self) -> str:
Expand All @@ -118,7 +120,7 @@ def project(self) -> str:

def _get_provider(self) -> Provider:
# TODO: Bake self.repo_path into self.config so that we dont only have one interface to paths
return get_provider(self.config, self.repo_path)
return self._provider

@log_exceptions_and_usage
def refresh_registry(self):
Expand Down

0 comments on commit 7f35793

Please # to comment.