msumit commented on a change in pull request #19041:
URL: https://github.com/apache/airflow/pull/19041#discussion_r731556817



##########
File path: airflow/providers/snowflake/hooks/snowflake.py
##########
@@ -302,3 +302,11 @@ def run(self, sql: Union[str, list], autocommit: bool = 
False, parameters: Optio
                 conn.commit()
 
         return execution_info
+
+    def test_connection(self):
+        """Tests the Snowflake connection by running a sample query"""
+        try:
+            self.run(sql="select 1")
+            return True, 'Connection successfully tested'
+        except Exception as e:
+            return False, str(e)

Review comment:
       In that case, we would need to catch the exception at one level above. 
Also, no point in changing the old code now. 




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