Skip to content

Commit 9442754

Browse files
committed
Update oura_data_download.py to reflect Oura API changes
1 parent 26a8759 commit 9442754

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/oura_data_download.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,10 @@ def dwnld_insert_oura_data(ath_un,db_host,db_name,superuser_un,superuser_pw,oura
300300
met_min_medium = row.met_min_medium
301301
non_wear = row.non_wear
302302
rest = row.rest
303-
rest_mode_state = row.rest_mode_state
303+
try:
304+
rest_mode_state = row.rest_mode_state
305+
except:
306+
rest_mode_state = None
304307
try:
305308
score = row.score
306309
score_meet_daily_targets = row.score_meet_daily_targets
@@ -410,8 +413,11 @@ def insert_element_list(lst, x, n):
410413

411414

412415
for row in readiness_df.itertuples():
413-
period_id = row.period_id
414-
rest_mode_state = row.rest_mode_state
416+
try:
417+
period_id = row.period_id
418+
rest_mode_state = row.rest_mode_state
419+
except:
420+
period_id = rest_mode_state = None
415421
score = row.score
416422
score_activity_balance = row.score_activity_balance
417423
score_hrv_balance = row.score_hrv_balance

0 commit comments

Comments
 (0)