You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/07/06 15:52:03 UTC

[airflow] branch main updated: Small fixes on the TabularConnection (#24874)

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

potiuk 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 2c4fd052b7 Small fixes on the TabularConnection (#24874)
2c4fd052b7 is described below

commit 2c4fd052b7ef757e96eb77621da171d97448d469
Author: Fokko Driesprong <fo...@apache.org>
AuthorDate: Wed Jul 6 17:51:48 2022 +0200

    Small fixes on the TabularConnection (#24874)
---
 .../connections.rst                                |  7 +++--
 docs/apache-airflow-providers-tabular/index.rst    |  4 +--
 tests/providers/tabular/hooks/test_tabular.py      | 34 ++++++++++------------
 3 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/docs/apache-airflow-providers-tabular/connections.rst b/docs/apache-airflow-providers-tabular/connections.rst
index ff73cd7267..a3e576309b 100644
--- a/docs/apache-airflow-providers-tabular/connections.rst
+++ b/docs/apache-airflow-providers-tabular/connections.rst
@@ -17,11 +17,13 @@
 
 .. _howto/connection:tabular:
 
-Tabular Connection
-==================
+Connecting to Tabular
+=====================
 
 The Tabular connection type enables connection to Tabular to request a short lived token to access the Apache Iceberg tables. This token can be injected as an environment variable, to be used with Trino, Spark, Flink or your favorite query engine that supports Apache Iceberg.
 
+After installing the Tabular provider in your Airflow environment, the corresponding connection type of ``tabular`` will be made available.
+
 Default Connection IDs
 ----------------------
 
@@ -29,6 +31,7 @@ Tabular Hook uses the parameter ``tabular_conn_id`` for Connection IDs and the v
 
 Configuring the Connection
 --------------------------
+
 Client ID
     The Client ID from Tabular
 
diff --git a/docs/apache-airflow-providers-tabular/index.rst b/docs/apache-airflow-providers-tabular/index.rst
index 554ed4a5d9..940bcb1140 100644
--- a/docs/apache-airflow-providers-tabular/index.rst
+++ b/docs/apache-airflow-providers-tabular/index.rst
@@ -60,7 +60,7 @@ Package apache-airflow-providers-tabular
 `Tabular <https://tabular.io/>`__
 
 
-Release: 0.0.1
+Release: 1.0.0
 
 Provider package
 ----------------
@@ -71,7 +71,7 @@ are in ``airflow.providers.tabular`` python package.
 Installation
 ------------
 
-You can install this package on top of an existing Airflow 2.1+ installation via
+You can install this package on top of an existing Airflow 2.2+ installation via
 ``pip install apache-airflow-providers-tabular``
 
 .. include:: ../../airflow/providers/tabular/CHANGELOG.rst
diff --git a/tests/providers/tabular/hooks/test_tabular.py b/tests/providers/tabular/hooks/test_tabular.py
index 639c43cded..f45a945aa5 100644
--- a/tests/providers/tabular/hooks/test_tabular.py
+++ b/tests/providers/tabular/hooks/test_tabular.py
@@ -15,28 +15,24 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-import unittest
 
 import requests_mock
 
 from airflow.providers.tabular.hooks.tabular import TabularHook
 
 
-class TestTabularHook(unittest.TestCase):
-    """Test endpoint"""
-
-    def test_tabular(self):
-        access_token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSU'
-        with requests_mock.Mocker() as m:
-            m.post(
-                'https://api.tabulardata.io/ws/v1/oauth/tokens',
-                json={
-                    'access_token': access_token,
-                    'token_type': 'Bearer',
-                    'expires_in': 86400,
-                    'warehouse_id': 'fadc4c31-e81f-48cd-9ce8-64cd5ce3fa5d',
-                    'region': 'us-west-2',
-                    'catalog_url': 'warehouses/fadc4c31-e81f-48cd-9ce8-64cd5ce3fa5d',
-                },
-            )
-            assert TabularHook().get_conn() == access_token
+def test_tabular_hook():
+    access_token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSU'
+    with requests_mock.Mocker() as m:
+        m.post(
+            'https://api.tabulardata.io/ws/v1/oauth/tokens',
+            json={
+                'access_token': access_token,
+                'token_type': 'Bearer',
+                'expires_in': 86400,
+                'warehouse_id': 'fadc4c31-e81f-48cd-9ce8-64cd5ce3fa5d',
+                'region': 'us-west-2',
+                'catalog_url': 'warehouses/fadc4c31-e81f-48cd-9ce8-64cd5ce3fa5d',
+            },
+        )
+        assert TabularHook().get_conn() == access_token