diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index e0accf4..72d117e 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -83,8 +83,8 @@ timelog["day_of_week"] = pd.to_datetime(timelog["date"]).dt.day_name() # If a project has been specified (task prefixed with a colon), then put the # project in its own column. -timelog['project'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', 1).str[0], None)) -timelog['description'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', 1).str[1], timelog['description'])) +timelog['project'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', n=1).str[0], None)) +timelog['description'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', n=1).str[1], timelog['description'])) # Mid-work clean up of description and new project. timelog['description'] = timelog['description'].str.strip() @@ -160,8 +160,8 @@ for preferred, alternatives in compound_project_tasks.items(): # If a compound project was specified, break that out into a sub-project (in # Harvest, we use Task, which is really task type, for this). -timelog['subproject'] = (np.where(timelog['project'].str.contains(' — '), timelog['project'].str.split(' — ', 1).str[1], None)) -timelog['project'] = (np.where(timelog['project'].str.contains(' — '), timelog['project'].str.split(' — ', 1).str[0], timelog['project'])) +timelog['subproject'] = (np.where(timelog['project'].str.contains(' — '), timelog['project'].str.split(' — ', n=1).str[1], None)) +timelog['project'] = (np.where(timelog['project'].str.contains(' — '), timelog['project'].str.split(' — ', n=1).str[0], timelog['project'])) # Replace irregular-but-known project names with ones timetracking tools use. harvest_project_names = {