ashb commented on code in PR #28239: URL: https://github.com/apache/airflow/pull/28239#discussion_r1047655862
########## airflow/utils/log/secrets_masker.py: ########## @@ -240,17 +241,58 @@ def redact(self, item: Redactable, name: str | None = None) -> Redacted: """ return self._redact(item, name, depth=0) - def add_mask(self, secret: str | dict | Iterable, name: str | None = None): - """Add a new secret to be masked to this filter instance.""" + @cached_property + def _mask_adapter(self) -> None | Callable: + """Pulls the secret mask adapter from config. + + This lives in a function here to be cached and only hit the config once. + """ from airflow.configuration import conf - test_mode: bool = conf.getboolean("core", "unit_test_mode") + mask_adapter: Callable | None = None + try: + mask_adapter = conf.getimport("logging", "secret_mask_adapter") + except AirflowConfigException: + pass + return mask_adapter Review Comment: I think this would work as ```suggestion return conf.getimport("logging", "secret_mask_adapter", fallback=None) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org