Skip to content

Commit

Permalink
Fix bad merge, add back compute_statistics method (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
davitbzh authored Jan 8, 2021
1 parent f2ce3d8 commit 626d96f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/hsfs/feature_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,27 @@ def get_statistics(self, commit_time: str = None):
else:
return self._statistics_engine.get(self, commit_time)

def compute_statistics(self):
"""Recompute the statistics for the feature group and save them to the
feature store.
Statistics are only computed for data in the offline storage of the feature
group.
# Returns
`Statistics`. The statistics metadata object.
# Raises
`RestAPIError`. Unable to persist the statistics.
"""
if self.statistics_config.enabled:
return self._statistics_engine.compute_statistics(self, self.read())
else:
warnings.warn(
(
"The statistics are not enabled of feature group `{}`, with version"
" `{}`. No statistics computed."
).format(self._name, self._version),
util.StorageWarning,
)


class FeatureGroup(FeatureGroupBase):
CACHED_FEATURE_GROUP = "CACHED_FEATURE_GROUP"
Expand Down

0 comments on commit 626d96f

Please sign in to comment.