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

Hide private params from logs #295

Closed ujiuji1259 closed 2 years ago

ujiuji1259 commented 2 years ago

I've implemented __str__ for task representations with only public parameters.

Problems

When running the task with private parameters, the worker now emits the logs including the raw values of private parameters.

This is caused by the implementation of __repr__ that builds the task representation with all the significant parameters, and str(task) calls it because __str__ is not implemented. It is reasonable that __repr__ Includes all the siginificant parameters since __repr__ should identify the task, but I think str(task) should not include private parameters.

Solution

I've implemented _get_task_string(only_public=False) and __str__, and added unittest for them.