-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Allow passing repo config path via flag #3077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
feast-ci-bot
merged 7 commits into
feast-dev:master
from
achals:achal/feature-repo-docs
Aug 15, 2022
+131
−67
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -114,30 +114,41 @@ class FeatureStore: | |
| repo_path: Path | ||
| _registry: BaseRegistry | ||
| _provider: Provider | ||
| _go_server: "EmbeddedOnlineFeatureServer" | ||
| _go_server: Optional["EmbeddedOnlineFeatureServer"] | ||
|
|
||
| @log_exceptions | ||
| def __init__( | ||
| self, | ||
| repo_path: Optional[str] = None, | ||
| config: Optional[RepoConfig] = None, | ||
| fs_yaml_file: Optional[Path] = None, | ||
| ): | ||
| """ | ||
| Creates a FeatureStore object. | ||
|
|
||
| Raises: | ||
| ValueError: If both or neither of repo_path and config are specified. | ||
| """ | ||
| if repo_path is not None and config is not None: | ||
| raise ValueError("You cannot specify both repo_path and config.") | ||
| if config is not None: | ||
| if fs_yaml_file is not None and config is not None: | ||
achals marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| raise ValueError("You cannot specify both fs_yaml_dir and config.") | ||
|
|
||
| if repo_path: | ||
| self.repo_path = Path(repo_path) | ||
| else: | ||
| self.repo_path = Path(os.getcwd()) | ||
|
|
||
| # If config is specified, or fs_yaml_file is specified, those take precedence over | ||
| # the default feature_store.yaml location under repo_path. | ||
| if config is not None: | ||
| self.config = config | ||
| elif repo_path is not None: | ||
| self.repo_path = Path(repo_path) | ||
| self.config = load_repo_config(Path(repo_path)) | ||
| elif fs_yaml_file is not None: | ||
| self.config = load_repo_config(self.repo_path, fs_yaml_file) | ||
| elif repo_path: | ||
| self.config = load_repo_config( | ||
| self.repo_path, Path(repo_path) / "feature_store.yaml" | ||
| ) | ||
| else: | ||
| raise ValueError("Please specify one of repo_path or config.") | ||
| raise ValueError("Please specify one of fs_yaml_dir or config.") | ||
|
|
||
| registry_config = self.config.get_registry_config() | ||
| if registry_config.registry_type == "sql": | ||
|
|
@@ -146,7 +157,8 @@ def __init__( | |
| r = Registry(registry_config, repo_path=self.repo_path) | ||
| r._initialize_registry(self.config.project) | ||
| self._registry = r | ||
| self._provider = get_provider(self.config, self.repo_path) | ||
|
|
||
| self._provider = get_provider(self.config) | ||
| self._go_server = None | ||
|
|
||
| @log_exceptions | ||
|
|
@@ -1569,7 +1581,7 @@ def _get_online_features( | |
| } | ||
|
|
||
| # If the embedded Go code is enabled, send request to it instead of going through regular Python logic. | ||
| if self.config.go_feature_retrieval: | ||
| if self.config.go_feature_retrieval and self._go_server: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @achals What was the reason for adding |
||
| self._lazy_init_go_server() | ||
|
|
||
| entity_native_values: Dict[str, List[Any]] | ||
|
|
@@ -2221,7 +2233,7 @@ def serve( | |
| ) -> None: | ||
| """Start the feature consumption server locally on a given port.""" | ||
| type_ = type_.lower() | ||
| if self.config.go_feature_serving: | ||
| if self.config.go_feature_serving and self._go_server: | ||
| # Start go server instead of python if the flag is enabled | ||
| self._lazy_init_go_server() | ||
| enable_logging = ( | ||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.