GeezerVison is showing github.com — fix: Date wise remote offline store historical data retrieval (#5686) · Marcus-Rosti/feast@949ba3d
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: sdk/python/feast/infra/offline_stores/remote.py +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -197,6 +197,7 @@ def get_historical_features( | 197 | 197 | registry: BaseRegistry, | 198 | 198 | project: str, | 199 | 199 | full_feature_names: bool = False, | | 200 | + **kwargs, | 200 | 201 | ) -> RemoteRetrievalJob: | 201 | 202 | assert isinstance(config.offline_store, RemoteOfflineStoreConfig) | 202 | 203 |
| @@ -219,6 +220,15 @@ def get_historical_features( | 219 | 220 | "name_aliases": name_aliases, | 220 | 221 | } | 221 | 222 |
| | 223 | + # Extract and serialize start_date/end_date for remote transmission | | 224 | + start_date = kwargs.get("start_date", None) | | 225 | + end_date = kwargs.get("end_date", None) | | 226 | + | | 227 | + if start_date is not None: | | 228 | + api_parameters["start_date"] = start_date.isoformat() | | 229 | + if end_date is not None: | | 230 | + api_parameters["end_date"] = end_date.isoformat() | | 231 | + | 222 | 232 | return RemoteRetrievalJob( | 223 | 233 | client=client, | 224 | 234 | api=OfflineStore.get_historical_features.__name__, | |
Collapse file Copy file name to clipboardExpand all lines: sdk/python/feast/offline_server.py +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -449,6 +449,17 @@ def get_historical_features(self, command: dict, key: Optional[str] = None): | 449 | 449 | resource=feature_view, actions=[AuthzedAction.READ_OFFLINE] | 450 | 450 | ) | 451 | 451 |
| | 452 | + # Extract and deserialize start_date/end_date if present | | 453 | + kwargs = {} | | 454 | + if "start_date" in command and command["start_date"] is not None: | | 455 | + kwargs["start_date"] = utils.make_tzaware( | | 456 | + datetime.fromisoformat(command["start_date"]) | | 457 | + ) | | 458 | + if "end_date" in command and command["end_date"] is not None: | | 459 | + kwargs["end_date"] = utils.make_tzaware( | | 460 | + datetime.fromisoformat(command["end_date"]) | | 461 | + ) | | 462 | + | 452 | 463 | retJob = self.offline_store.get_historical_features( | 453 | 464 | config=self.store.config, | 454 | 465 | feature_views=feature_views, | @@ -457,6 +468,7 @@ def get_historical_features(self, command: dict, key: Optional[str] = None): | 457 | 468 | registry=self.store.registry, | 458 | 469 | project=project, | 459 | 470 | full_feature_names=full_feature_names, | | 471 | + **kwargs, | 460 | 472 | ) | 461 | 473 |
| 462 | 474 | return retJob | |
|