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

villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new bb6ee9e7229 fix(clickhouse): remove _mutate_label workaround and bump 
clickhouse-connect to >=0.13.0 (#38280)
bb6ee9e7229 is described below

commit bb6ee9e7229856c13c392e86e56ccc1372ea8789
Author: Joe Spadola <[email protected]>
AuthorDate: Thu Feb 26 16:12:54 2026 -0800

    fix(clickhouse): remove _mutate_label workaround and bump 
clickhouse-connect to >=0.13.0 (#38280)
---
 UPDATING.md                                        |  4 ++++
 docs/src/data/databases.json                       | 10 +++++-----
 pyproject.toml                                     |  2 +-
 superset/db_engine_specs/clickhouse.py             | 22 +++++-----------------
 .../unit_tests/db_engine_specs/test_clickhouse.py  | 17 -----------------
 5 files changed, 15 insertions(+), 40 deletions(-)

diff --git a/UPDATING.md b/UPDATING.md
index 83e22ced382..7b887b1aa36 100644
--- a/UPDATING.md
+++ b/UPDATING.md
@@ -24,6 +24,10 @@ assists people when migrating to a new version.
 
 ## Next
 
+### ClickHouse minimum driver version bump
+
+The minimum required version of `clickhouse-connect` has been raised to 
`>=0.13.0`. If you are using the ClickHouse connector, please upgrade your 
`clickhouse-connect` package. The `_mutate_label` workaround that appended hash 
suffixes to column aliases has also been removed, as it is no longer needed 
with modern versions of the driver.
+
 ### MCP Tool Observability
 
 MCP (Model Context Protocol) tools now include enhanced observability 
instrumentation for monitoring and debugging:
diff --git a/docs/src/data/databases.json b/docs/src/data/databases.json
index 18eac0ddf34..ed8106d2b9b 100644
--- a/docs/src/data/databases.json
+++ b/docs/src/data/databases.json
@@ -751,14 +751,14 @@
           "OPEN_SOURCE"
         ],
         "pypi_packages": [
-          "clickhouse-connect>=0.6.8"
+          "clickhouse-connect>=0.13.0"
         ],
         "connection_string": 
"clickhousedb://{username}:{password}@{host}:{port}/{database}",
         "default_port": 8123,
         "drivers": [
           {
             "name": "clickhouse-connect (Recommended)",
-            "pypi_package": "clickhouse-connect>=0.6.8",
+            "pypi_package": "clickhouse-connect>=0.13.0",
             "connection_string": 
"clickhousedb://{username}:{password}@{host}:{port}/{database}",
             "is_recommended": true,
             "notes": "Official ClickHouse Python driver with native protocol 
support."
@@ -781,7 +781,7 @@
             "connection_string": "clickhousedb://localhost/default"
           }
         ],
-        "install_instructions": "echo \"clickhouse-connect>=0.6.8\" >> 
./docker/requirements-local.txt",
+        "install_instructions": "echo \"clickhouse-connect>=0.13.0\" >> 
./docker/requirements-local.txt",
         "compatible_databases": [
           {
             "name": "ClickHouse Cloud",
@@ -794,7 +794,7 @@
               "HOSTED_OPEN_SOURCE"
             ],
             "pypi_packages": [
-              "clickhouse-connect>=0.6.8"
+              "clickhouse-connect>=0.13.0"
             ],
             "connection_string": 
"clickhousedb://{username}:{password}@{host}:8443/{database}?secure=true",
             "parameters": {
@@ -816,7 +816,7 @@
               "HOSTED_OPEN_SOURCE"
             ],
             "pypi_packages": [
-              "clickhouse-connect>=0.6.8"
+              "clickhouse-connect>=0.13.0"
             ],
             "connection_string": 
"clickhousedb://{username}:{password}@{host}/{database}?secure=true",
             "docs_url": "https://docs.altinity.com/";
diff --git a/pyproject.toml b/pyproject.toml
index 12138dcd3d0..62e91573480 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -120,7 +120,7 @@ bigquery = [
     "sqlalchemy-bigquery>=1.15.0",
     "google-cloud-bigquery>=3.10.0",
 ]
-clickhouse = ["clickhouse-connect>=0.5.14, <1.0"]
+clickhouse = ["clickhouse-connect>=0.13.0, <1.0"]
 cockroachdb = ["cockroachdb>=0.3.5, <0.4"]
 crate = ["sqlalchemy-cratedb>=0.40.1, <1"]
 d1 = [
diff --git a/superset/db_engine_specs/clickhouse.py 
b/superset/db_engine_specs/clickhouse.py
index 4d5caf8c1ff..a998dce75e5 100644
--- a/superset/db_engine_specs/clickhouse.py
+++ b/superset/db_engine_specs/clickhouse.py
@@ -42,7 +42,6 @@ from superset.db_engine_specs.exceptions import 
SupersetDBAPIDatabaseError
 from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
 from superset.extensions import cache_manager
 from superset.utils.core import GenericDataType
-from superset.utils.hashing import hash_from_str
 from superset.utils.network import is_hostname_valid, is_port_open
 
 if TYPE_CHECKING:
@@ -288,13 +287,13 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, 
ClickHouseEngineSpec):
             DatabaseCategory.ANALYTICAL_DATABASES,
             DatabaseCategory.OPEN_SOURCE,
         ],
-        "pypi_packages": ["clickhouse-connect>=0.6.8"],
+        "pypi_packages": ["clickhouse-connect>=0.13.0"],
         "connection_string": 
"clickhousedb://{username}:{password}@{host}:{port}/{database}",
         "default_port": 8123,
         "drivers": [
             {
                 "name": "clickhouse-connect (Recommended)",
-                "pypi_package": "clickhouse-connect>=0.6.8",
+                "pypi_package": "clickhouse-connect>=0.13.0",
                 "connection_string": (
                     
"clickhousedb://{username}:{password}@{host}:{port}/{database}"
                 ),
@@ -330,7 +329,7 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, 
ClickHouseEngineSpec):
             },
         ],
         "install_instructions": (
-            'echo "clickhouse-connect>=0.6.8" >> 
./docker/requirements-local.txt'
+            'echo "clickhouse-connect>=0.13.0" >> 
./docker/requirements-local.txt'
         ),
         "compatible_databases": [
             {
@@ -347,7 +346,7 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, 
ClickHouseEngineSpec):
                     DatabaseCategory.CLOUD_DATA_WAREHOUSES,
                     DatabaseCategory.HOSTED_OPEN_SOURCE,
                 ],
-                "pypi_packages": ["clickhouse-connect>=0.6.8"],
+                "pypi_packages": ["clickhouse-connect>=0.13.0"],
                 "connection_string": (
                     
"clickhousedb://{username}:{password}@{host}:8443/{database}?secure=true"
                 ),
@@ -372,7 +371,7 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, 
ClickHouseEngineSpec):
                     DatabaseCategory.CLOUD_DATA_WAREHOUSES,
                     DatabaseCategory.HOSTED_OPEN_SOURCE,
                 ],
-                "pypi_packages": ["clickhouse-connect>=0.6.8"],
+                "pypi_packages": ["clickhouse-connect>=0.13.0"],
                 "connection_string": (
                     
"clickhousedb://{username}:{password}@{host}/{database}?secure=true"
                 ),
@@ -518,17 +517,6 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, 
ClickHouseEngineSpec):
             ]
         return []
 
-    @staticmethod
-    def _mutate_label(label: str) -> str:
-        """
-        Suffix with the first six characters from the md5 of the label to avoid
-        collisions with original column names
-
-        :param label: Expected expression label
-        :return: Conditionally mutated label
-        """
-        return f"{label}_{hash_from_str(label)[:6]}"
-
     @classmethod
     def adjust_engine_params(
         cls,
diff --git a/tests/unit_tests/db_engine_specs/test_clickhouse.py 
b/tests/unit_tests/db_engine_specs/test_clickhouse.py
index 0c42bc19492..5f56554e82d 100644
--- a/tests/unit_tests/db_engine_specs/test_clickhouse.py
+++ b/tests/unit_tests/db_engine_specs/test_clickhouse.py
@@ -212,23 +212,6 @@ def test_connect_get_column_spec(
     assert_column_spec(spec, native_type, sqla_type, attrs, generic_type, 
is_dttm)
 
 
[email protected](
-    "column_name,expected_result",
-    [
-        # SHA-256 hash suffix (first 6 chars) with default HASH_ALGORITHM
-        ("time", "time_336074"),
-        ("count", "count_6c3549"),
-    ],
-)
-def test_connect_make_label_compatible(column_name: str, expected_result: str) 
-> None:
-    from superset.db_engine_specs.clickhouse import (
-        ClickHouseConnectEngineSpec as spec,  # noqa: N813
-    )
-
-    label = spec.make_label_compatible(column_name)
-    assert label == expected_result
-
-
 @pytest.mark.parametrize(
     "schema, expected_result",
     [

Reply via email to