Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide private params from logs #295

Merged
merged 3 commits into from
Jul 31, 2022

Conversation

ujiuji1259
Copy link
Collaborator

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.

Copy link
Collaborator

@hirosassa hirosassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ujiuji1259 Thank you for your contribution! LGTM!

Copy link
Contributor

@mski-iksm mski-iksm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ujiuji1259
LGTM! Thank you for the contribution!

@mski-iksm mski-iksm merged commit 5c7a763 into m3dev:master Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants