Repository: bryzgaloff/airflow-clickhouse-plugin (language: python)

Issue:
Support Airflow 2.1.4
According to this job: https://github.com/bryzgaloff/airflow-clickhouse-plugin/actions/runs/3496964766

Airflow 2.1.4 for some reason does not force installation of `typing-extensions` and an SQL sensor cannot be used.

🟢  **If you are here for a quick solution for Airflow v2.1, simply `pip install typing-extensions`**.

Potential solutions:
* Install `typing-extensions` conditionally. And support in the tests.
* Add a note to README for a user to install manually.


Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index a5c40bf..a12baa6 100644
--- a/README.md
+++ b/README.md
@@ -34,14 +34,15 @@ Different versions of the plugin support different combinations of Python and
     If you need to use the plugin with older Python-Airflow combinations, pick a
     suitable plugin version:
 
-| airflow-clickhouse-plugin version | Airflow version | Python version     |
-|-----------------------------------|-----------------|--------------------|
-| 0.8.2                             | \>=2.0.0,<2.4.0 | ~=3.7              |
-| 0.8.0,0.8.1                       | \>=2.0.0,<2.3.0 | ~=3.6              |
-| 0.7.0                             | \>=2.0.0,<2.2.0 | ~=3.6              |
-| 0.6.0                             | ~=2.0.1         | ~=3.6              |
-| \>=0.5.4,<0.6.0                   | ~=1.10.6        | \>=2.7 or >=3.5.\* |
-| \>=0.5.0,<0.5.4                   | ==1.10.6        | \>=2.7 or >=3.5.\* |
+| airflow-clickhouse-plugin version | Airflow version         | Python version     |
+|-----------------------------------|-------------------------|--------------------|
+| 0.9.0                             | ~=2.0.0,\>=2.2.0,<2.5.0 | ~=3.7              |
+| 0.8.2                             | \>=2.0.0,<2.4.0         | ~=3.7              |
+| 0.8.0,0.8.1                       | \>=2.0.0,<2.3.0         | ~=3.6              |
+| 0.7.0                             | \>=2.0.0,<2.2.0         | ~=3.6              |
+| 0.6.0                             | ~=2.0.1                 | ~=3.6              |
+| \>=0.5.4,<0.6.0                   | ~=1.10.6                | \>=2.7 or >=3.5.\* |
+| \>=0.5.0,<0.5.4                   | ==1.10.6                | \>=2.7 or >=3.5.\* |
 
 `~=` means compatible release, see [PEP 440][pep-440-compatible-releases] for an
     explanation.
diff --git a/airflow_clickhouse_plugin/__version__.py b/airflow_clickhouse_plugin/__version__.py
index f8fe08f..c33da8c 100644
--- a/airflow_clickhouse_plugin/__version__.py
+++ b/airflow_clickhouse_plugin/__version__.py
@@ -9,7 +9,7 @@
 __description__ = \
     'airflow-clickhouse-plugin - ' \
     'Airflow plugin to execute ClickHouse commands and queries'
-__version__ = '0.8.2'
+__version__ = '0.9.0'
 __url__ = 'https://github.com/bryzgaloff/airflow-clickhouse-plugin'
 __license__ = 'MIT License'
 __author__ = 'Anton Bryzgalov'
diff --git a/airflow_clickhouse_plugin/sensors/clickhouse_sql_sensor.py b/airflow_clickhouse_plugin/sensors/clickhouse_sql_sensor.py
index d561229..0196e61 100644
--- a/airflow_clickhouse_plugin/sensors/clickhouse_sql_sensor.py
+++ b/airflow_clickhouse_plugin/sensors/clickhouse_sql_sensor.py
@@ -1,6 +1,6 @@
 from typing import Dict, Callable, Any, Optional
 
-from airflow.sensors.sql import SqlSensor
+from airflow.providers.common.sql.sensors.sql import SqlSensor
 from airflow.utils.decorators import apply_defaults
 from airflow_clickhouse_plugin.hooks.clickhouse_hook import ClickHouseHook
 
diff --git a/requirements.txt b/requirements.txt
index 17f5a44..177d932 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,2 @@
 clickhouse-driver~=0.2.0
-apache-airflow>=2.0.0,<2.4.0
+apache-airflow>=2.0.0,<2.5.0
diff --git a/setup.py b/setup.py
index 3742e5b..7dff1f2 100755
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@
     python_requires=">=3.7.*",
     install_requires=install_requires,
     extras_require={
-        'pandas': ['apache-airflow[pandas]>=2.0.0,<2.4.0'],
+        'pandas': ['apache-airflow[pandas]>=2.0.0,<2.5.0'],
     },
     license=about.__license__,
     zip_safe=False,


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index cf68ecd..9674638 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -22,7 +22,7 @@ jobs:
     strategy:
       matrix:
         python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
-        airflow-version: ["2.0.2", "2.1.4", "2.2.5", "2.3.4"]
+        airflow-version: ["2.0.2", "2.2.5", "2.3.4", "2.4.3"]
     steps:
     - uses: actions/checkout@v2
     - name: Set up Python ${{ matrix.python-version }}
@@ -41,7 +41,7 @@ jobs:
     strategy:
       matrix:
         python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
-        airflow-version: ["2.0.2", "2.1.4", "2.2.5", "2.3.4"]
+        airflow-version: ["2.0.2", "2.2.5", "2.3.4", "2.4.3"]
     services:
       clickhouse:
         image: yandex/clickhouse-server
diff --git a/tests/unit/test_sql_sensor.py b/tests/unit/test_sql_sensor.py
index 6555263..c0bb29d 100644
--- a/tests/unit/test_sql_sensor.py
+++ b/tests/unit/test_sql_sensor.py
@@ -110,11 +110,9 @@ def tearDownClass(cls) -> None:
 
 
 class ClickHouseLegacySqlSensorTestCase(unittest.TestCase):
-    @mock.patch('airflow.sensors.sql.SqlSensor.poke')
-    @mock.patch('airflow.sensors.sql.SqlSensor._get_hook', create=True)
+    @mock.patch('airflow.providers.common.sql.sensors.sql.SqlSensor.poke')
     def test_get_hook_defined(
             self,
-            _: mock.MagicMock,  # force creation of _get_hook
             sql_sensor_poke_mock: mock.MagicMock,
     ):
         """ Test for case when ``SqlSensor._get_hook`` method is present. """