Skip to content

Commit

Permalink
[HOPSWORKS-3201][append] set training dataset start end time (logical…
Browse files Browse the repository at this point in the history
…clocks#679)

* fix unavailable event time

* fix style
  • Loading branch information
kennethmhc authored Jun 16, 2022
1 parent ded198a commit 8d37269
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions python/hsfs/core/feature_view_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 8d37269

Please sign in to comment.