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 2020/12/03 10:48:01 UTC

[GitHub] [airflow] ashb commented on a change in pull request #12775: BugFix: Adds support for special characters in DbApiHook

ashb commented on a change in pull request #12775:
URL: https://github.com/apache/airflow/pull/12775#discussion_r535090476



##########
File path: airflow/hooks/dbapi_hook.py
##########
@@ -78,7 +79,7 @@ def get_uri(self) -> str:
         conn = self.get_connection(getattr(self, self.conn_name_attr))
         login = ''
         if conn.login:
-            login = '{conn.login}:{conn.password}@'.format(conn=conn)
+            login = '{quote_plus(conn.login)}:{quote_plus(conn.password)}@'.format(conn=conn)

Review comment:
       This isn't an f-string, so you can't use quote_plus like this.
   
   ```suggestion
               login = '{login}:{pass}@'.format(login=quote_plus(conn.login), pass=quote_plus(conn.password))
   ```
   
   or
   
   ```suggestion
               login = f'{quote_plus(conn.login)}:{quote_plus(conn.password)}@'
   ```




----------------------------------------------------------------
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:
users@infra.apache.org