A FeatureStore object is used to define, create, and retrieve features. Attributes: config: The config for the feature store. repo_path: The path to the feature repo. _registry: The registry for the feature store. _provider: The provider for the feature stor
| 144 | |
| 145 | |
| 146 | class FeatureStore: |
| 147 | """ |
| 148 | A FeatureStore object is used to define, create, and retrieve features. |
| 149 | |
| 150 | Attributes: |
| 151 | config: The config for the feature store. |
| 152 | repo_path: The path to the feature repo. |
| 153 | _registry: The registry for the feature store. |
| 154 | _provider: The provider for the feature store. |
| 155 | _openlineage_emitter: Optional OpenLineage emitter for lineage tracking. |
| 156 | """ |
| 157 | |
| 158 | config: RepoConfig |
| 159 | repo_path: Path |
| 160 | _registry: Optional[BaseRegistry] |
| 161 | _provider: Optional[Provider] |
| 162 | _openlineage_emitter: Optional[Any] = None |
| 163 | _feature_service_cache: Dict[str, List[str]] |
| 164 | |
| 165 | def __init__( |
| 166 | self, |
| 167 | repo_path: Optional[str] = None, |
| 168 | config: Optional[RepoConfig] = None, |
| 169 | fs_yaml_file: Optional[Path] = None, |
| 170 | ): |
| 171 | """ |
| 172 | Creates a FeatureStore object. |
| 173 | |
| 174 | Args: |
| 175 | repo_path (optional): Path to the feature repo. Defaults to the current working directory. |
| 176 | config (optional): Configuration object used to configure the feature store. |
| 177 | fs_yaml_file (optional): Path to the `feature_store.yaml` file used to configure the feature store. |
| 178 | At most one of 'fs_yaml_file' and 'config' can be set. |
| 179 | |
| 180 | Raises: |
| 181 | ValueError: If both or neither of repo_path and config are specified. |
| 182 | """ |
| 183 | if fs_yaml_file is not None and config is not None: |
| 184 | raise ValueError("You cannot specify both fs_yaml_file and config.") |
| 185 | |
| 186 | configure_ca_trust_store_env_variables() |
| 187 | |
| 188 | if repo_path: |
| 189 | self.repo_path = Path(repo_path) |
| 190 | else: |
| 191 | self.repo_path = Path(os.getcwd()) |
| 192 | |
| 193 | # If config is specified, or fs_yaml_file is specified, those take precedence over |
| 194 | # the default feature_store.yaml location under repo_path. |
| 195 | if config is not None: |
| 196 | self.config = config |
| 197 | elif fs_yaml_file is not None: |
| 198 | self.config = load_repo_config(self.repo_path, fs_yaml_file) |
| 199 | else: |
| 200 | self.config = load_repo_config( |
| 201 | self.repo_path, utils.get_default_yaml_file_path(self.repo_path) |
| 202 | ) |
| 203 |
no outgoing calls