This is an automated email from the ASF dual-hosted git repository.

pankaj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 6ac50c901b Fix D105 checks for SSH provider (#38013)
6ac50c901b is described below

commit 6ac50c901bcdbcb23ce500345fa7f3074b2be4d9
Author: mahdi alizade <[email protected]>
AuthorDate: Mon Mar 11 10:00:07 2024 +0330

    Fix D105 checks for SSH provider (#38013)
    
    Co-authored-by: mehdi.alizade <[email protected]>
---
 airflow/providers/ssh/hooks/ssh.py | 2 ++
 pyproject.toml                     | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/providers/ssh/hooks/ssh.py 
b/airflow/providers/ssh/hooks/ssh.py
index 5ed59622a7..788f5f3f0a 100644
--- a/airflow/providers/ssh/hooks/ssh.py
+++ b/airflow/providers/ssh/hooks/ssh.py
@@ -375,9 +375,11 @@ class SSHHook(BaseHook):
         category=AirflowProviderDeprecationWarning,
     )
     def __enter__(self) -> SSHHook:
+        """Return an instance of SSHHook when the `with` statement is used."""
         return self
 
     def __exit__(self, exc_type, exc_val, exc_tb) -> None:
+        """Clear ssh client after exiting the `with` statement block."""
         if self.client is not None:
             self.client.close()
             self.client = None
diff --git a/pyproject.toml b/pyproject.toml
index 880731a4c9..cd786e9364 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1470,7 +1470,6 @@ combine-as-imports = true
 "airflow/providers/microsoft/psrp/hooks/psrp.py" = ["D105"]
 "airflow/providers/samba/hooks/samba.py" = ["D105"]
 "airflow/providers/smtp/hooks/smtp.py" = ["D105"]
-"airflow/providers/ssh/hooks/ssh.py" = ["D105"]
 "airflow/providers/tableau/hooks/tableau.py" = ["D105"]
 
 [tool.ruff.lint.flake8-tidy-imports]

Reply via email to