From 8d3726911d56876a3ad5e2e55b0ac5e1b610d4dd Mon Sep 17 00:00:00 2001 From: kennethmhc Date: Thu, 16 Jun 2022 16:55:40 +0800 Subject: [PATCH] [HOPSWORKS-3201][append] set training dataset start end time (#679) * fix unavailable event time * fix style --- python/hsfs/core/feature_view_engine.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/python/hsfs/core/feature_view_engine.py b/python/hsfs/core/feature_view_engine.py index 406fbd98ea..3ef62e6e1f 100644 --- a/python/hsfs/core/feature_view_engine.py +++ b/python/hsfs/core/feature_view_engine.py @@ -227,18 +227,34 @@ def _set_event_time(self, feature_view_obj, training_dataset_obj): split.name == TrainingDatasetSplit.TRAIN and not split.start_time ): - df = feature_view_obj.query.read() if df is None else df + df = ( + feature_view_obj.query._left_feature_group.select_all().read() + if df is None + else df + ) split.start_time = self._get_start_time(df, event_time) if split.name == TrainingDatasetSplit.TEST and not split.end_time: - df = feature_view_obj.query.read() if df is None else df + df = ( + feature_view_obj.query._left_feature_group.select_all().read() + if df is None + else df + ) split.end_time = self._get_end_time(df, event_time) else: if not training_dataset_obj.event_start_time: - df = feature_view_obj.query.read() if df is None else df + df = ( + feature_view_obj.query._left_feature_group.select_all().read() + if df is None + else df + ) training_dataset_obj.event_start_time = self._get_start_time( df, event_time ) - df = feature_view_obj.query.read() if df is None else df + df = ( + feature_view_obj.query._left_feature_group.select_all().read() + if df is None + else df + ) training_dataset_obj.event_end_time = self._get_end_time( df, event_time )