This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 25e315995e Remove worrying log message about redaction from the
OpenLineage plugin (#31149)
25e315995e is described below
commit 25e315995e53afef83fe310426c29e3bea14cd27
Author: Ash Berlin-Taylor <[email protected]>
AuthorDate: Tue May 9 13:49:43 2023 +0100
Remove worrying log message about redaction from the OpenLineage plugin
(#31149)
The current published plugin calls `_redact_all` directly, so when we
added the `max_depth` parameter in 2.6 (precisely so it didn't need to
call this private function directly!) we broke that.
This change leads to some worrying logs appearing in task logs for
anyone with the plugin installed:
```
[2023-05-05, 11:56:17 BST] {utils.py:490} WARNING - Unable to redact
[]Error was: TypeError: SecretsMasker._redact_all() missing 1 required
positional argument: 'max_depth'
[2023-05-05, 11:56:17 BST] {utils.py:490} WARNING - Unable to redact
[]Error was: TypeError: SecretsMasker._redact_all() missing 1 required
positional argument: 'max_depth'
[2023-05-05, 11:56:17 BST] {utils.py:490} WARNING - Unable to redact
NoneError was: TypeError: SecretsMasker._redact_all() missing 1 required
positional argument: 'max_depth'
```
This patch makes that previous change backwards compatible for that with
no change in behaviour for new code.
---
airflow/utils/log/secrets_masker.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/airflow/utils/log/secrets_masker.py
b/airflow/utils/log/secrets_masker.py
index cac82d0dd1..6703139a3b 100644
--- a/airflow/utils/log/secrets_masker.py
+++ b/airflow/utils/log/secrets_masker.py
@@ -207,7 +207,9 @@ class SecretsMasker(logging.Filter):
return True
- def _redact_all(self, item: Redactable, depth: int, max_depth: int) ->
Redacted:
+ # Default on `max_depth` is to support versions of the OpenLineage plugin
(not the provider) which called
+ # this function directly. New versions of that provider, and this class
itself call it with a value
+ def _redact_all(self, item: Redactable, depth: int, max_depth: int =
MAX_RECURSION_DEPTH) -> Redacted:
if depth > max_depth or isinstance(item, str):
return "***"
if isinstance(item, dict):