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

transform data before logging #33

Open
edublancas opened this issue Jan 9, 2023 · 0 comments
Open

transform data before logging #33

edublancas opened this issue Jan 9, 2023 · 0 comments

Comments

@edublancas
Copy link
Contributor

There are cases where we want to log input parameters but we need to process them before logging them. This happens when they might contain sensitive information. For example, in ploomber-engine, users can pass arbitrary parameters to a notebook. However, the values might contain sensitive data, so we only want to log the parameters' keys.

We can add something like this:

@telemetry.log_call(log_args=True, preprocessors={"parameters": lambda params: list(parameters)})
def do_stuff(parameters):
    pass

Then, when calling:

do_stuff(parameters={"key": "value", "key_another": "value_another"})

We log: ["key", "key_another"]

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

No branches or pull requests

1 participant