Fokko commented on a change in pull request #3941: [AIRFLOW-3106] Validate 
Postgres connection after saving it
URL: https://github.com/apache/incubator-airflow/pull/3941#discussion_r219897919
 
 

 ##########
 File path: airflow/hooks/postgres_hook.py
 ##########
 @@ -60,6 +60,15 @@ def get_conn(self):
         self.conn = psycopg2.connect(**conn_args)
         return self.conn
 
+    def validate_conn(self):
+        try:
+            conn = self.get_conn()
 
 Review comment:
   Can you change this to `with self.get_conn()`? So it closes automagically.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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