nodyke113 commented on issue #55198:
URL: https://github.com/apache/airflow/issues/55198#issuecomment-3265566717

   I manually patched AsyncKubernetesHook like this:
   
       async def __extract_extra(self, conn: Connection):
           from airflow.sdk.execution_time.secrets_masker import mask_secret
           extra = {}
           if conn.extra:
             try:
               extra = json.loads(conn.extra)
             except JSONDecodeError:
               logging.exception("Failed to deserialize extra property `extra`, 
returning empty dictionary")
           else:
               await sync_to_async(mask_secret)(extra)
           return extra 
         
       async def get_conn_extras(self) -> dict:
           if self._extras is None:
               if self.conn_id:
                   connection = await 
sync_to_async(self.get_connection)(self.conn_id)
                   self._extras = await self.__extract_extra(connection)
               else:
                   self._extras = {}
           return self._extras
   
   And it works fine. Main changes: I wrapped mask_secret using sync_to_async
   
   
   


-- 
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]

Reply via email to