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.
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, andstr(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 thinkstr(task)
should not include private parameters.Solution
I've implemented
_get_task_string(only_public=False)
and__str__
, and added unittest for them.