diff --git a/README.md b/README.md index cb37361..39eb0dd 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ Aligned helps improving ML system visibility, while also reducing technical, and data debt, as described in [Sculley et al. [2015]](https://papers.nips.cc/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf). +## Docs + +Check out the [Aligned Docs](https://www.aligned.codes), but keep in mind that they are still work in progress. + +--- + Want to look at examples of how to use `aligned`? View the [`MatsMoll/aligned-example` repo](https://github.com/MatsMoll/aligned-example). diff --git a/aligned/feature_source.py b/aligned/feature_source.py index 0a4ecec..ec4da70 100644 --- a/aligned/feature_source.py +++ b/aligned/feature_source.py @@ -26,7 +26,9 @@ class FeatureSource: def features_for(self, facts: RetrivalJob, request: FeatureRequest) -> RetrivalJob: raise NotImplementedError() - async def freshness_for(self, locations: list[FeatureLocation]) -> dict[FeatureLocation, datetime]: + async def freshness_for( + self, locations: dict[FeatureLocation, EventTimestamp] + ) -> dict[FeatureLocation, datetime]: raise NotImplementedError() diff --git a/aligned/feature_store.py b/aligned/feature_store.py index 6d9656a..f35573e 100644 --- a/aligned/feature_store.py +++ b/aligned/feature_store.py @@ -654,6 +654,17 @@ def features_for(self, entities: dict[str, list] | RetrivalJob) -> RetrivalJob: return job.filter(request.features_to_include) + async def freshness(self) -> dict[FeatureLocation, datetime]: + from aligned.schemas.feature import EventTimestamp + + locs: dict[FeatureLocation, EventTimestamp] = {} + + for req in self.request().needed_requests: + if req.event_timestamp: + locs[req.location] + + return await self.store.feature_source.freshness_for(locs) + def with_labels(self) -> SupervisedModelFeatureStore: """Will also load the labels for the model diff --git a/aligned/feature_view/feature_view.py b/aligned/feature_view/feature_view.py index a638cf2..8144497 100644 --- a/aligned/feature_view/feature_view.py +++ b/aligned/feature_view/feature_view.py @@ -262,6 +262,7 @@ def compile_with_metadata(feature_view: Any, metadata: FeatureViewMetadata) -> C event_timestamp=None, stream_data_source=metadata.stream_source, application_source=metadata.application_source, + staging_source=metadata.staging_source, indexes=[], ) aggregations: list[FeatureFactory] = []