From df64927f5a6fdf8c19b181f07bd5145f53ea2acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Melan=C3=A7on?= Date: Fri, 28 May 2021 14:24:07 -0400 Subject: [PATCH] Force non-date values to 'not a time' that still let's column be datetime --- pomodoro_to_harvest.py | 2 +- settings.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 807789e..88fda11 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -66,7 +66,7 @@ timelog = timelog.explode("description").reset_index() if debug: mess = copy.deepcopy(timelog) -timelog["started"] = pd.to_datetime(timelog["started"]).dt.tz_convert("US/Eastern") +timelog["started"] = pd.to_datetime(timelog["started"], errors='coerce').dt.tz_convert("US/Eastern") timelog["recorded"] = pd.to_datetime(timelog["recorded"]).dt.tz_convert("US/Eastern") latest_recorded = settings.pomodoro_latest_recorded() diff --git a/settings.py b/settings.py index 8629ebf..fc85a5e 100644 --- a/settings.py +++ b/settings.py @@ -14,8 +14,11 @@ def write(): if not os.path.isfile('settings.ini'): # Set some essential initial values. - pomodoro['logfile'] = '~/Projects/agaric/python/pomodoroprompt/log/timelog.csv' - # This path must be absolute, for some reason using ~ for home isn t wor:: + + # pomodoro['logfile'] = '~/Projects/agaric/python/pomodoroprompt/log/timelog.csv' + pomodoro['logfile'] = '' + + # This path must be absolute, for some reason using ~ for home isn't working: pomodoro['logpath'] = '/home/mlncn/Projects/agaric/python/pomodoroprompt/log/' write()