Skip to content

Commit e79267e

Browse files
fix: chdb-core 26.5.0 compatibility — composite leaf coercion, PK paren strip, inverted upstream-bug locks (#12)
chdb-core 26.5.0 (the ClickHouse 26.5 baseline, on PyPI 2026-06-08) changed three behaviors vs 26.3 and turned the nightly CI red: 1. Float / Decimal / temporal leaves inside Array / Tuple / Map / Nested / geo cells are now serialised as quoted strings ("['1.5', '2.5']" for Array(Float64)) where 26.3 emitted bare numerics. The cursor wrapper now walks composite cells recursively, driven by the column's ClickHouse type string, and re-coerces leaves to native types. Container shapes are preserved as parsed; named Tuple cells (returned as dicts by chdb.dbapi) keep the dict shape with coerced values. 2. ClickHouse 26.5 preserves wrapping parens around a single-column sorting key in system.tables.sorting_key (ORDER BY (user_id) used to be reported as user_id), which broke get_pk_constraint with constrained_columns=['(user_id)']. Reflection now strips parens that wrap the entire expression before splitting. 3. chdb-core 26.5 fixed the two upstream bugs our torture tests locked: Decimal(P>18) precision loss (chdb-io/chdb#574) and Float NaN/±Inf folding to None (chdb-io/chdb#575). Both locks are inverted to assert the fixed behavior, as their failure messages prescribed. The L5 differential reference binary moves from clickhouse-server:26.3.9.8-lts to clickhouse-server:26.5.1.882 to match the new baseline; the version-skew sanity test guards the pairing. All cursor coercions are no-ops on chdb-core 26.3 native values, so the wrapper works on both binary generations. New torture tests lock the leaf repair for each composite shape that regressed. Co-authored-by: Claude Fable 5 <[email protected]>
1 parent f07cdb4 commit e79267e

8 files changed

Lines changed: 454 additions & 95 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,17 @@ jobs:
142142
- uses: actions/setup-python@v5
143143
with:
144144
python-version: "3.12"
145-
- name: Extract clickhouse binary from LTS image
145+
- name: Extract clickhouse binary from server image
146146
run: |
147-
# Try tags from most-specific to least-specific. ClickHouse's
148-
# Docker Hub publishes some patch tags (``X.Y.Z.W-lts``) and
149-
# rolling tags (``X.Y-lts``, ``lts``). The patch-specific tag
150-
# may rotate out, so fall back to the rolling tags. The
151-
# differential test's own version check ([:3] of version())
152-
# will surface any unexpected major.minor.patch drift as a
153-
# test failure rather than a silent pass.
147+
# The tag must track chdb-core's ClickHouse baseline (26.5.1 as
148+
# of chdb-core 26.5.0) — the differential test's own version
149+
# check ([:3] of version()) fails loudly on drift, so a chdb
150+
# baseline bump shows up here as a red version-skew test, not a
151+
# silent pass. Try tags from most-specific to least-specific:
152+
# patch tags (``X.Y.Z.W``) may rotate out, so fall back to the
153+
# rolling ``X.Y.Z`` / ``X.Y`` tags.
154154
set -e
155-
for tag in "26.3.9.8-lts" "26.3-lts" "lts" "26.3.9.8" "26.3"; do
155+
for tag in "26.5.1.882" "26.5.1" "26.5"; do
156156
if docker pull "clickhouse/clickhouse-server:$tag" 2>/dev/null; then
157157
echo "Using clickhouse/clickhouse-server:$tag"
158158
docker create --name ch-extract "clickhouse/clickhouse-server:$tag"

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,48 @@ All notable changes to `chdb-sqlalchemy` are recorded here.
44
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.2.2] — 2026-06-12
8+
9+
Compatibility release for chdb-core 26.5.0 (the ClickHouse 26.5
10+
baseline), which changed three behaviors that chdb-core 26.3 had and
11+
turned the nightly CI red from 2026-06-08. All fixes are
12+
backward-compatible: the cursor coercions are no-ops on chdb-core 26.3
13+
native values.
14+
15+
### Fixed
16+
17+
- **Composite cells lost numeric typing on chdb-core 26.5** — the new
18+
binary serialises Float / Decimal / temporal leaves *inside*
19+
`Array` / `Tuple` / `Map` / `Nested` / geo cells as quoted strings
20+
(`"['1.5', '2.5']"` for `Array(Float64)`), where 26.3 emitted bare
21+
numerics. The cursor wrapper now walks composite cells recursively,
22+
driven by the column's ClickHouse type string, and re-coerces leaves
23+
to native `float` / `Decimal` / `int` / `date` / `datetime` / `time`.
24+
Container shapes are preserved exactly as parsed; named `Tuple`
25+
cells (which chdb.dbapi returns as dicts keyed by field name) keep
26+
the dict shape with coerced values.
27+
- **PK reflection returned `['(user_id)']` on ClickHouse 26.5** — the
28+
server now preserves wrapping parentheses around a single-column
29+
sorting key in `system.tables.sorting_key` (`ORDER BY (user_id)`
30+
used to be reported as `user_id`). Reflection strips parens that
31+
wrap the entire expression before splitting, so
32+
`get_pk_constraint` returns bare column names on both server
33+
generations.
34+
35+
### Changed
36+
37+
- **Decimal high-precision lock inverted** — chdb-core 26.5 fixed the
38+
double round-trip that lossified `Decimal(P>18)` cells
39+
(chdb-io/chdb#574). The torture test that locked the lossy behavior
40+
now asserts full-precision round-trip instead.
41+
- **Float NaN / ±Inf lock inverted** — chdb-core 26.5 fixed the fold
42+
to `None` on readback (chdb-io/chdb#575). The torture test now
43+
asserts the values come back as real floats.
44+
- L5 differential reference binary bumped from
45+
`clickhouse-server:26.3.9.8-lts` to `clickhouse-server:26.5.1.882`
46+
to match the chdb-core 26.5 baseline; the version-skew sanity test
47+
guards the pairing.
48+
749
## [0.2.1] — 2026-05-21
850

951
### Added

0 commit comments

Comments
 (0)