From 716ff3c592382089893fedd4e24ae055c9fbe421 Mon Sep 17 00:00:00 2001 From: Meng Li <34143965+Meng6@users.noreply.github.com> Date: Fri, 26 Feb 2021 11:09:31 -0500 Subject: [PATCH] Fix PRICE provider's bug when input is an empty dataframe --- src/features/fitbit_sleep_intraday/price/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/features/fitbit_sleep_intraday/price/main.py b/src/features/fitbit_sleep_intraday/price/main.py index fb7d38b1..a0869a2b 100644 --- a/src/features/fitbit_sleep_intraday/price/main.py +++ b/src/features/fitbit_sleep_intraday/price/main.py @@ -181,6 +181,9 @@ def price_features(sensor_data_files, time_segment, provider, filter_data_by_seg features_fullnames = featuresFullNames(intraday_features_to_compute, sleep_levels_to_compute, day_types_to_compute) sleep_intraday_features = pd.DataFrame(columns=features_fullnames) + if sleep_intraday_data.empty: + return sleep_intraday_features + # Filter by segemnts and chunk episodes sleep_intraday_data = filter_data_by_segment(sleep_intraday_data, time_segment)