From 013f466b1d63d3533bdea443dddc2c976a21877d Mon Sep 17 00:00:00 2001 From: Fabio Buso Date: Wed, 13 Jul 2022 15:00:12 +0200 Subject: [PATCH] [HOPSWORKS-3235] Append avoid index out of range when reading the feature group (#713) (cherry picked from commit ac15fc3da04bbb396bb39ea0ade4960932716dad) --- python/hsfs/feature_group.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/hsfs/feature_group.py b/python/hsfs/feature_group.py index ac765a131d..68a34dafe8 100644 --- a/python/hsfs/feature_group.py +++ b/python/hsfs/feature_group.py @@ -722,13 +722,17 @@ def __init__( self._partition_key = [ feat.name for feat in self._features if feat.partition is True ] - if time_travel_format is not None and time_travel_format.upper() == "HUDI": + if ( + time_travel_format is not None + and time_travel_format.upper() == "HUDI" + and self._features + ): # hudi precombine key is always a single feature self._hudi_precombine_key = [ feat.name for feat in self._features if feat.hudi_precombine_key is True - ][0] + ] else: self._hudi_precombine_key = None