Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions docs/src/data/databases.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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",
Expand All @@ -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": {
Expand All @@ -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/"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
22 changes: 5 additions & 17 deletions superset/db_engine_specs/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
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:
Expand Down Expand Up @@ -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}"
),
Expand Down Expand Up @@ -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": [
{
Expand All @@ -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"
),
Expand All @@ -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"
),
Expand Down Expand Up @@ -518,17 +517,6 @@ def validate_parameters(
]
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,
Expand Down
17 changes: 0 additions & 17 deletions tests/unit_tests/db_engine_specs/test_clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,6 @@ def test_connect_get_column_spec(
assert_column_spec(spec, native_type, sqla_type, attrs, generic_type, is_dttm)


@pytest.mark.parametrize(
"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",
[
Expand Down
Loading