Skip to content

[Bug] Empty numeric results not handled properly #6

@bartvanb

Description

@bartvanb

Describe the bug

info > wrapper for v6-summary-py
info > Reading input file /mnt/data/task-000000022/input
info > Dispatching ...
info > Module 'v6-summary-py' imported!
info > Reading token
info > Defining input parameters
info > Creating subtask for all organizations in the collaboration
info > Waiting for results
info > Waiting for results of task 11...
info > Waiting for results of task 11...
info > Waiting for results of task 11...
info > Done!
info > Results obtained!
info > Aggregating partial summaries
error > Error encountered while calling summary: 'numeric'
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/vantage6/algorithm/tools/wrap.py", line 126, in _run_algorithm_method
    result = method(args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/vantage6/algorithm/tools/decorators.py", line 108, in decorator
    return func(client,args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/v6-summary-py/central.py", line 82, in summary
    results = _aggregate_partial_summaries(results)
  File "/usr/local/lib/python3.10/site-packages/v6-summary-py/central.py", line 191, in _aggregate_partial_summaries
    if not aggregated_summary["numeric"].empty:
error > None
KeyError: 'numeric'

Reported by Kluivert in Discord

Workaround
Error could be prevented by specifying which columns were numeric.

To Reproduce
?

Expected behavior
No error.

Details
From first inspection of the code, I could not work out how this error could occur. I think that in all cases the key should exist, unless there are 0 results, but in that case, I think other errors should be raised before (?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions