m3dev / gokart

Gokart solves reproducibility, task dependencies, constraints of good code, and ease of use for Machine Learning Pipeline.
https://gokart.readthedocs.io/en/latest/
MIT License
305 stars 57 forks source link

[Bug] Failure when def output returns dict and using build #220

Closed TaylerUva closed 3 years ago

TaylerUva commented 3 years ago

An attribute error is raised when creating a def output() that returns a dictionary and the task is run with gokart build.

gokart/gokart/build.py", line 35, in _get_output
    return output.load()
AttributeError: 'dict' object has no attribute 'load'
def _get_output(task: TaskOnKart) -> Any:
    output = task.output()
    if type(output) == list:
        return [x.load() for x in output]
    return output.load()

_get_output only checks for a list but output should also support tuple and dict