Closed kompotkot closed 1 year ago
Hey @zomglings Not sure if this is already in the PR, but it would be nice to make the key comparison case-insensitive, and also make it so any key contains the "token" substring is excluded.
For example, this is what @istranic 's blacklist_fn
would look like:
def activeloop_parameter_blacklist_fn(parameters: Dict[str, Any]) -> Dict[str, Any]:
return {k:v for k, v in paramters.items() if "token" in k.lower()}
He could instantiate reporter as:
ActiveloopReporter = HumbugReporter(..., blacklist_fn=activeloop_parameters_blacklist_fn)
@kompotkot : Suggest some changes: https://github.com/bugout-dev/humbug/pull/96
Changes
During reporter creation specify list of
blacklisted_keys
like:After it all
@humbug_reporter.record_call
automatically remove blacklisted keys from arguments.Also, if blacklisted keys required in report, it could be set manually to ignore blacklist with
humbug_reporter.feature_report(..., blacklist_apply=False)
How to test these changes?
Added test cases and tested locally with API.
Related issues