This is an automated email from the ASF dual-hosted git repository.
taragolis 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 89aa437ef9 Add apache kylin conn type and kylin connection docs
(#36413)
89aa437ef9 is described below
commit 89aa437ef98bba97ba14245d4ea3b61c443b2a25
Author: shohamy7 <[email protected]>
AuthorDate: Mon Dec 25 11:09:42 2023 +0200
Add apache kylin conn type and kylin connection docs (#36413)
* Add apache kylin conn type and kylin connection docs
* Change default kylin_conn_id to the default_conn_name variable
---
airflow/providers/apache/kylin/hooks/kylin.py | 7 +++-
airflow/providers/apache/kylin/provider.yaml | 4 ++
.../connections.rst | 47 ++++++++++++++++++++++
.../index.rst | 7 ++++
4 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/airflow/providers/apache/kylin/hooks/kylin.py
b/airflow/providers/apache/kylin/hooks/kylin.py
index a8865bcaf1..cfc2021f66 100644
--- a/airflow/providers/apache/kylin/hooks/kylin.py
+++ b/airflow/providers/apache/kylin/hooks/kylin.py
@@ -32,9 +32,14 @@ class KylinHook(BaseHook):
:param dsn: dsn
"""
+ conn_name_attr = "kylin_conn_id"
+ default_conn_name = "kylin_default"
+ conn_type = "kylin"
+ hook_name = "Apache Kylin"
+
def __init__(
self,
- kylin_conn_id: str = "kylin_default",
+ kylin_conn_id: str = default_conn_name,
project: str | None = None,
dsn: str | None = None,
):
diff --git a/airflow/providers/apache/kylin/provider.yaml
b/airflow/providers/apache/kylin/provider.yaml
index 459f0ef589..114fd01ae4 100644
--- a/airflow/providers/apache/kylin/provider.yaml
+++ b/airflow/providers/apache/kylin/provider.yaml
@@ -57,3 +57,7 @@ hooks:
- integration-name: Apache Kylin
python-modules:
- airflow.providers.apache.kylin.hooks.kylin
+
+connection-types:
+ - hook-class-name: airflow.providers.apache.kylin.hooks.kylin.KylinHook
+ connection-type: kylin
diff --git a/docs/apache-airflow-providers-apache-kylin/connections.rst
b/docs/apache-airflow-providers-apache-kylin/connections.rst
new file mode 100644
index 0000000000..9d66003996
--- /dev/null
+++ b/docs/apache-airflow-providers-apache-kylin/connections.rst
@@ -0,0 +1,47 @@
+ .. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ .. http://www.apache.org/licenses/LICENSE-2.0
+
+ .. Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+Apache Kylin Connection
+=======================
+
+The Apache Kylin connection type enables connection to Apache Kylin.
+
+Default Connection IDs
+----------------------
+
+Kylin Hook uses parameter ``kylin_conn_id`` for Connection IDs and the value
of the
+parameter as ``kylin_default`` by default.
+
+Configuring the Connection
+--------------------------
+Host
+ The host of the Kylin cluster (should be without scheme).
+
+Port
+ Specify the port to use for connecting the Kylin cluster.
+
+Schema
+ The default Kylin project that will be used, if not specified.
+
+Login
+ The user that will be used for authentication against the Kylin cluster.
+
+Password
+ The password of the user that will be used for authentication against the
Kylin cluster.
+
+Extra (optional, connection parameters)
+ Specify the extra parameters (as json dictionary) that can be used in
Kylin connection.
diff --git a/docs/apache-airflow-providers-apache-kylin/index.rst
b/docs/apache-airflow-providers-apache-kylin/index.rst
index 938779057f..1275b43a5d 100644
--- a/docs/apache-airflow-providers-apache-kylin/index.rst
+++ b/docs/apache-airflow-providers-apache-kylin/index.rst
@@ -29,6 +29,13 @@
Changelog <changelog>
Security <security>
+.. toctree::
+ :hidden:
+ :maxdepth: 1
+ :caption: Guides
+
+ Connection types <connections>
+
.. toctree::
:hidden:
:maxdepth: 1