Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wl status fails if there is no entry at all #8

Closed
nils-braun opened this issue Aug 31, 2020 · 0 comments · Fixed by #9
Closed

wl status fails if there is no entry at all #8

nils-braun opened this issue Aug 31, 2020 · 0 comments · Fixed by #9
Assignees
Labels
bug Something isn't working

Comments

@nils-braun
Copy link

When running wl status for the first time, it fails if no entry is created so far.

pip install dcs-worklog
> wl status # fine
Fatal: No log data available. Start a new log entry with 'wl commit start'.
> wl commit start -t 08:05
> wl status                                                                                                                                                                                           20-08-31 10:16
Traceback (most recent call last):
  File "/home/brn2rng/anaconda3/envs/worklog/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2889, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 97, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'time'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/brn2rng/anaconda3/envs/worklog/bin/wl", line 8, in <module>
    sys.exit(run())
  File "/home/brn2rng/anaconda3/envs/worklog/lib/python3.8/site-packages/worklog/__init__.py", line 46, in run
    dispatch(log, parser, cli_args, cfg)
  File "/home/brn2rng/anaconda3/envs/worklog/lib/python3.8/site-packages/worklog/dispatcher.py", line 52, in dispatch
    log.status(hours_target, hours_max, query_date=query_date, fmt=fmt)
  File "/home/brn2rng/anaconda3/envs/worklog/lib/python3.8/site-packages/worklog/log.py", line 223, in status
    all_touched_tasks = get_all_task_ids_with_duration(self._log_df[sel_task_mask])
  File "/home/brn2rng/anaconda3/envs/worklog/lib/python3.8/site-packages/worklog/utils/tasks.py", line 42, in get_all_task_ids_with_duration
    s = df_h["time"]
  File "/home/brn2rng/anaconda3/envs/worklog/lib/python3.8/site-packages/pandas/core/frame.py", line 2902, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/home/brn2rng/anaconda3/envs/worklog/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2891, in get_loc
    raise KeyError(key) from err
KeyError: 'time'
@dotcs dotcs self-assigned this Aug 31, 2020
@dotcs dotcs added the bug Something isn't working label Aug 31, 2020
@dotcs dotcs closed this as completed in #9 Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants