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



##########
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:
       Hmm, I was thinking perhaps we should raise something here instead of 
returning; and this function doesn't really need to return anything; the fact 
it doesn't raise would be enough to represent the `True` case.




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