You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/08/19 07:59:00 UTC

[GitHub] [airflow] Taragolis commented on a diff in pull request #25810: Avoid circular import problems when instantiating AWS SM backend

Taragolis commented on code in PR #25810:
URL: https://github.com/apache/airflow/pull/25810#discussion_r949910732


##########
airflow/providers/amazon/aws/secrets/secrets_manager.py:
##########
@@ -193,8 +196,11 @@ def _format_uri_with_extra(secret, conn_string: str) -> str:
 
         return conn_string
 
-    def get_connection(self, conn_id: str) -> Optional[Connection]:
+    def get_connection(self, conn_id: str) -> Optional["Connection"]:
         if not self.full_url_mode:
+            # Avoid circular import problems when instantiating the backend during configuration.
+            from airflow.models.connection import Connection

Review Comment:
   Personally I have no idea how to catch such an issue, rather than just manually run some simple command for all known SecretsBackends:
   
   ```
   ❯ export AIRFLOW__SECRETS__BACKEND=full.qualified.name.to.SB
   ❯ export AIRFLOW__SECRETS__BACKEND_KWARGS='{}'
   ❯ export airflow version
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

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