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

fail_on_empty_dump cannot be executed as in the example in the document #281

Closed yamasakih closed 2 years ago

yamasakih commented 2 years ago

Hi,

Thank you for your documentation. The documentation describing useful methods for Pandas is very helpful. But, when I tried to execute fail_on_empty_dump as described in the documentation, I got the following error.

def run(self):
    ...
    self.fail_on_empty_dump(df)

cf. https://gokart.readthedocs.io/en/latest/for_pandas.html#fail-on-empty-dataframe

Traceback (most recent call last):
  File "/opt/conda/envs/sample/lib/python3.6/site-packages/luigi/worker.py", line 191, in run
    new_deps = self._run_get_new_deps()
  File "/opt/conda/envs/sample/lib/python3.6/site-packages/luigi/worker.py", line 133, in _run_get_new_deps
    task_gen = self.task.run()
  File "/workspaces/sample/task.py", line 475, in run
    self.fail_on_empty_dump(df)
TypeError: 'bool' object is not callable

I think this error occurred because fail_on_empty_dump is a parameter, i.e. attribute, and not a method.

https://github.com/m3dev/gokart/blob/27358e28bcada98027bd4541f5e6f161192fb49e/gokart/task.py#L64

I have submitted a pull request with updated documentation to describe it as a parameter, so please merge it if you like. https://github.com/m3dev/gokart/pull/282

Hi-king commented 2 years ago

282 has merged. Thx.