pgagnon commented on a change in pull request #6822: [AIRFLOW-5616] Refactor 
presto hook to support transactions.
URL: https://github.com/apache/airflow/pull/6822#discussion_r357992816
 
 

 ##########
 File path: airflow/hooks/presto_hook.py
 ##########
 @@ -44,18 +45,22 @@ class PrestoHook(DbApiHook):
     def get_conn(self):
         """Returns a connection object"""
         db = self.get_connection(self.presto_conn_id)
-        reqkwargs = None
+        auth = None
         if db.password is not None:
-            reqkwargs = {'auth': HTTPBasicAuth(db.login, db.password)}
-        return presto.connect(
+            auth = prestodb.auth.BasicAuthentication(db.login, db.password)
 
 Review comment:
   This block could be replaced with `auth = 
prestodb.auth.BasicAuthentication(db.login, db.password) if db.password else 
None`. This would also allow you to inline this at line 61.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to