Skip to content

Commit

Permalink
[HOPSWORKS-2188] Append - fix time_travel_format.upper() if None (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
davitbzh committed Jan 7, 2021
1 parent ce659ad commit f2ce3d8
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions python/hsfs/feature_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

class FeatureGroupBase:
def __init__(self, featurestore_id):
self._feature_group_base_engine = feature_group_base_engine.FeatureGroupBaseEngine(
featurestore_id
self._feature_group_base_engine = (
feature_group_base_engine.FeatureGroupBaseEngine(featurestore_id)
)
self._statistics_engine = statistics_engine.StatisticsEngine(
featurestore_id, self.ENTITY_TYPE
Expand Down Expand Up @@ -352,7 +352,7 @@ def __init__(
self._partition_key = [
feat.name for feat in self._features if feat.partition is True
]
if time_travel_format.upper() == "HUDI":
if time_travel_format is not None and time_travel_format.upper() == "HUDI":
# hudi precombine key is always a single feature
self._hudi_precombine_key = [
feat.name
Expand All @@ -367,7 +367,10 @@ def __init__(
self._primary_key = primary_key
self._partition_key = partition_key
self._hudi_precombine_key = (
hudi_precombine_key if time_travel_format.upper() == "HUDI" else None
hudi_precombine_key
if time_travel_format is not None
and time_travel_format.upper() == "HUDI"
else None
)

self._feature_group_engine = feature_group_engine.FeatureGroupEngine(
Expand Down Expand Up @@ -433,10 +436,18 @@ def read(
return (
self.select_all()
.as_of(wallclock_time)
.read(online, dataframe_type, read_options,)
.read(
online,
dataframe_type,
read_options,
)
)
else:
return self.select_all().read(online, dataframe_type, read_options,)
return self.select_all().read(
online,
dataframe_type,
read_options,
)

def read_changes(
self,
Expand Down Expand Up @@ -860,8 +871,8 @@ def __init__(
self._feat_hist_enabled = feat_hist_enabled
self._statistic_columns = statistic_columns

self._feature_group_engine = on_demand_feature_group_engine.OnDemandFeatureGroupEngine(
featurestore_id
self._feature_group_engine = (
on_demand_feature_group_engine.OnDemandFeatureGroupEngine(featurestore_id)
)

if self._id:
Expand Down

0 comments on commit f2ce3d8

Please sign in to comment.