Update fitbit_parse_sleep.py

pull/95/head
Meng Li 2020-06-05 17:28:43 -04:00
parent 56645d66b1
commit 9c1f2f6bbe
1 changed files with 2 additions and 1 deletions

View File

@ -200,8 +200,9 @@ def parseOneRecordForV12(record, device_id, d_is_main_sleep, records_summary, re
def parseSleepData(sleep_data, HOUR2EPOCH): def parseSleepData(sleep_data, HOUR2EPOCH):
SLEEP_SUMMARY_COLUMNS = SLEEP_SUMMARY_COLUMNS_V1_2
if sleep_data.empty: if sleep_data.empty:
return pd.DataFrame(columns=SLEEP_SUMMARY_COLUMNS_V1), pd.DataFrame(columns=SLEEP_INTRADAY_COLUMNS) return pd.DataFrame(columns=SLEEP_SUMMARY_COLUMNS), pd.DataFrame(columns=SLEEP_INTRADAY_COLUMNS)
device_id = sleep_data["device_id"].iloc[0] device_id = sleep_data["device_id"].iloc[0]
records_summary, records_intraday = [], [] records_summary, records_intraday = [], []
# Parse JSON into individual records # Parse JSON into individual records