uranusjr commented on a change in pull request #19041:
URL: https://github.com/apache/airflow/pull/19041#discussion_r735272946
##########
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:
```suggestion
def test_connection(self):
"""Test the Snowflake connection by running a simple query."""
try:
self.run(sql="select 1")
except Exception as e:
return False, str(e)
return True, "Connection successfully tested"
```
?
--
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]