amoghrajesh commented on code in PR #54449:
URL: https://github.com/apache/airflow/pull/54449#discussion_r2285738152
##########
shared/secrets_masker/src/airflow_shared/secrets_masker/secrets_masker.py:
##########
@@ -157,17 +148,25 @@ def merge(
return _secrets_masker().merge(new_value, old_value, name, max_depth)
-@cache
+_global_secrets_masker: SecretsMasker | None = None
+
+
def _secrets_masker() -> SecretsMasker:
- for flt in logging.getLogger("airflow.task").filters:
- if isinstance(flt, SecretsMasker):
- return flt
- raise RuntimeError(
- "Logging Configuration Error! No SecretsMasker found! If you have
custom logging, please make "
- "sure you configure it taking airflow configuration as a base as
explained at "
-
"https://airflow.apache.org/docs/apache-airflow/stable/logging-monitoring/logging-tasks.html"
- "#advanced-configuration"
- )
+ """
+ Get or create the global secrets masker instance.
+
+ This function implements a module level singleton pattern to ensure
consistent
+ secrets masking behavior across all shared Airflow dists, regardless of
import path.
+
+ Needed because:
+ - shared code can be accessed via different symlink paths (airflow._shared
vs
+ airflow.sdk._shared)
Review Comment:
Handled it now, wdyt?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]