From 91c75db7e0e1bc369048f404985b5ee682e14dfc Mon Sep 17 00:00:00 2001 From: Bert Palm <bert.palm@ufz.de> Date: Wed, 7 Oct 2020 14:32:56 +0200 Subject: [PATCH] warning for unused to_mask --- saqc/core/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/saqc/core/core.py b/saqc/core/core.py index c733da06a..0c18d93b1 100644 --- a/saqc/core/core.py +++ b/saqc/core/core.py @@ -303,7 +303,12 @@ def _saqcCallFunc(func_dump, data, flagger): elif masking == 'field': columns = [field] else: - raise ValueError(f"masking: {masking}") + raise ValueError(f"wrong use of `register(masking={masking})`") + + # warn if the user explicitly pass `to_mask=..` to a function that is + # decorated by `register(masking='none')`, and so `to_mask` is ignored. + if masking == 'none' and to_mask not in (None, []): + logging.warning("`to_mask` is given, but the test ignore masking. Please refer to the documentation: TODO") to_mask = flagger.BAD if to_mask is None else to_mask # NOTE: -- GitLab