uranusjr commented on code in PR #58062:
URL: https://github.com/apache/airflow/pull/58062#discussion_r2532434537


##########
airflow-core/src/airflow/models/connection.py:
##########
@@ -339,6 +339,24 @@ def get_uri(self) -> str:
 
         return uri
 
+    def _safe_decrypt(self, fld: str) -> str:
+        """Safely decrypt and decode a field with proper error handling."""
+        from cryptography.fernet import InvalidToken
+
+        fernet = get_fernet()
+        try:
+            as_bytes = bytes(fld, "utf-8")
+        except (TypeError, UnicodeEncodeError):
+            return fld

Review Comment:
   The input shouldn’t be returned without at least a log. Maybe let’s not do 
this here, but in a separate PR? This PR is for type changes, but this function 
changes logic.



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