kaxil commented on a change in pull request #9008:
URL: https://github.com/apache/airflow/pull/9008#discussion_r432544185



##########
File path: airflow/providers/amazon/aws/secrets/secrets_manager.py
##########
@@ -83,43 +86,87 @@ def client(self):
         )
         return session.client(service_name="secretsmanager", **self.kwargs)
 
-    def get_conn_uri(self, conn_id: str) -> Optional[str]:
+    def get_conn_uri(self, conn_id: str):
         """
         Get Connection Value
 
         :param conn_id: connection id
         :type conn_id: str
         """
-        return self._get_secret(self.connections_prefix, conn_id)
+        if self.connections_prefix and self.sep:
+            conn_id = self.build_path(self.connections_prefix, conn_id, 
self.sep)
 
-    def get_variable(self, key: str) -> Optional[str]:
+        try:
+            secret_string = self._get_secret(conn_id)
+            secret = ast.literal_eval(secret_string)
+        except ValueError:  # 'malformed node or string: ' error, for empty 
conns
+            connection = None
+
+        # These lines will check if we have with some denomination stored an 
username, password and host
+        if secret:
+            for user_denomination in ['user', 'username', 'login']:

Review comment:
       yes avoid the nested blocks if possible, if it is unavoidable then just 
add `# pylint: disable=too-many-nested-blocks` at the end of the line where it 
complains.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to