girder/girder_worker

_maybe_transform_argument mischaracterizes pandas.DataFrame as transform

Opened this issue · 0 comments

The check in task.py incorrectly tries to use a DataFrame as a transform since it has a transform method.

Resulting stack on calling a simple task function locally:

Traceback (most recent call last):
  File "example.py", line 14, in <module>
    result = anova(data)
  File "/Users/jeff/.virtualenvs/pyscience/lib/python3.6/site-packages/celery/local.py", line 191, in __call__
    return self._get_current_object()(*a, **kw)
  File "/Users/jeff/.virtualenvs/pyscience/lib/python3.6/site-packages/girder_worker/task.py", line 145, in __call__
    _t_args = _walk_obj(args, self._maybe_transform_argument)
  File "/Users/jeff/.virtualenvs/pyscience/lib/python3.6/site-packages/girder_worker_utils/__init__.py", line 39, in _walk_obj
    return tuple(_walk_obj(list(obj), func, leaf_condition=leaf_condition))
  File "/Users/jeff/.virtualenvs/pyscience/lib/python3.6/site-packages/girder_worker_utils/__init__.py", line 36, in _walk_obj
    return [_walk_obj(v, func, leaf_condition=leaf_condition) for v in obj]
  File "/Users/jeff/.virtualenvs/pyscience/lib/python3.6/site-packages/girder_worker_utils/__init__.py", line 36, in <listcomp>
    return [_walk_obj(v, func, leaf_condition=leaf_condition) for v in obj]
  File "/Users/jeff/.virtualenvs/pyscience/lib/python3.6/site-packages/girder_worker_utils/__init__.py", line 41, in _walk_obj
    return func(obj)
  File "/Users/jeff/.virtualenvs/pyscience/lib/python3.6/site-packages/girder_worker/task.py", line 136, in _maybe_transform_argument
    return arg.transform(**kwargs)
TypeError: transform() missing 1 required positional argument: 'func'