dstandish commented on a change in pull request #18692:
URL: https://github.com/apache/airflow/pull/18692#discussion_r722833687



##########
File path: airflow/providers/amazon/aws/secrets/systems_manager.py
##########
@@ -101,6 +105,37 @@ def get_conn_uri(self, conn_id: str) -> Optional[str]:
 
         return self._get_secret(self.connections_prefix, conn_id)
 
+    def get_conn_kwargs(self, conn_id: str) -> Optional[str]:
+        if self.connections_prefix is None:
+            return None
+
+        val = self._get_secret(path_prefix=self.connections_prefix, 
secret_id=conn_id)
+        if val:
+            kwargs = json.loads(val)
+            extra = kwargs.pop('extra', None)
+            if extra:
+                kwargs['extra'] = extra if isinstance(extra, str) else 
json.dumps(extra)
+            return kwargs
+
+    def get_connection(self, conn_id: str) -> Optional['Connection']:
+        """
+        Return connection object with a given ``conn_id``.
+
+        :param conn_id: connection id
+        :type conn_id: str
+        """
+        from airflow.models.connection import Connection

Review comment:
       yup good point, copy paste oversight




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