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

joshfell 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 6ee4d402e5 fix connection type webhdfs (#36145)
6ee4d402e5 is described below

commit 6ee4d402e542e92ac2167867cd6711ac9ab4f0cf
Author: Ankur Bajaj <ankurbaj...@gmail.com>
AuthorDate: Wed Dec 13 04:39:09 2023 +0100

    fix connection type webhdfs (#36145)
    
    * Requested changes
    
    * To make the connection visible in the list
    
    * formatting
---
 airflow/providers/apache/hdfs/hooks/webhdfs.py | 7 ++++++-
 airflow/providers/apache/hdfs/provider.yaml    | 4 ++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/airflow/providers/apache/hdfs/hooks/webhdfs.py 
b/airflow/providers/apache/hdfs/hooks/webhdfs.py
index e99e20127e..fdfdfc0c5a 100644
--- a/airflow/providers/apache/hdfs/hooks/webhdfs.py
+++ b/airflow/providers/apache/hdfs/hooks/webhdfs.py
@@ -52,7 +52,12 @@ class WebHDFSHook(BaseHook):
     :param proxy_user: The user used to authenticate.
     """
 
-    def __init__(self, webhdfs_conn_id: str = "webhdfs_default", proxy_user: 
str | None = None):
+    conn_type = "webhdfs"
+    conn_name_attr = "webhdfs_conn_id"
+    default_conn_name = "webhdfs_default"
+    hook_name = "Apache WebHDFS"
+
+    def __init__(self, webhdfs_conn_id: str = default_conn_name, proxy_user: 
str | None = None):
         super().__init__()
         self.webhdfs_conn_id = webhdfs_conn_id
         self.proxy_user = proxy_user
diff --git a/airflow/providers/apache/hdfs/provider.yaml 
b/airflow/providers/apache/hdfs/provider.yaml
index 8984b1652b..f796b23873 100644
--- a/airflow/providers/apache/hdfs/provider.yaml
+++ b/airflow/providers/apache/hdfs/provider.yaml
@@ -70,3 +70,7 @@ hooks:
   - integration-name: WebHDFS
     python-modules:
       - airflow.providers.apache.hdfs.hooks.webhdfs
+
+connection-types:
+  - hook-class-name: airflow.providers.apache.hdfs.hooks.webhdfs.WebHDFSHook
+    connection-type: webhdfs

Reply via email to