You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/16 03:25:13 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #19609: add test_connection method for sftp hook

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



##########
File path: airflow/providers/sftp/hooks/sftp.py
##########
@@ -320,3 +320,11 @@ def append_matching_path_callback(list_):
         )
 
         return files, dirs, unknowns
+
+    def test_connection(self) -> Tuple[bool, str]:
+        """Test the SFTP connection by checking if remote entity '/some/path' exists"""
+        try:
+            self.path_exists('/some/path')

Review comment:
       I think this can be made slightly cheaper to
   
   ```suggestion
               self.get_conn().pwd
   ```




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org