dabla commented on code in PR #68506:
URL: https://github.com/apache/airflow/pull/68506#discussion_r3425898070
##########
task-sdk/src/airflow/sdk/log.py:
##########
@@ -264,6 +264,28 @@ def mask_secret(secret: JsonValue, name: str | None =
None) -> None:
comms.send(MaskSecret(value=secret, name=name))
+async def amask_secret(secret: JsonValue, name: str | None = None) -> None:
+ """
+ Async version of mask_secret for use in async contexts.
+
+ Uses asend() instead of send() to avoid deadlock when called from within
+ an async task that already has an asend() in flight.
+ """
+ from contextlib import suppress
+
+ from airflow.sdk._shared.secrets_masker import _secrets_masker
+
Review Comment:
I suppose I did it like this because the sync version of mask_secret also
does local imports, but will move it to top of file as you suggested, also no
idea why it's done like that originally? Maybe @amoghrajesh has a good reason
as he wrote this?
--
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]