uranusjr commented on a change in pull request #21540:
URL: https://github.com/apache/airflow/pull/21540#discussion_r810807374



##########
File path: airflow/utils/log/secrets_masker.py
##########
@@ -147,7 +147,12 @@ def _record_attrs_to_ignore(self) -> Iterable[str]:
         return frozenset(record.__dict__).difference({'msg', 'args'})
 
     def _redact_exception_with_context(self, exception):
-        exception.args = (self.redact(v) for v in exception.args)
+        # In case, when exception has "read only" properties, we need
+        # to catch an AttributeError to log properly

Review comment:
       ```suggestion
           # Exception class may not be modifiable (e.g. declared by an 
extension
           # module such as JDBC).
   ```

##########
File path: airflow/utils/log/secrets_masker.py
##########
@@ -147,7 +147,12 @@ def _record_attrs_to_ignore(self) -> Iterable[str]:
         return frozenset(record.__dict__).difference({'msg', 'args'})
 
     def _redact_exception_with_context(self, exception):
-        exception.args = (self.redact(v) for v in exception.args)
+        # In case, when exception has "read only" properties, we need
+        # to catch an AttributeError to log properly

Review comment:
       ```suggestion
           # Exception class may not be modifiable (e.g. declared by an
           # extension module such as JDBC).
   ```




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