clickhouse-connect v1.12.0
Highlights
Features
ping()on the sync and async clients accepts an optionaltimeoutin seconds (default 3). Closes #192.- New
get_client(dedicated_pool=True)gives a synchronous HTTP client its own connection pool. Closing a client-owned pool now closes idle connections immediately. Closes #1121.
Performance
- Faster
Arraycolumn reads with the C extensions in all query methods. Related to #1008. - Faster Cython decoding of
DateandDate32columns. - Faster
query_dfreads ofMap, nullable integer, nullable date, and timezone-aware nullable datetime columns with the Python codec. AsyncClient.query_rows_streamreads each block in one executor call instead of one per row, so it is much faster.- Faster client creation with non-UTC IANA server timezones. Closes #1120.
- Eligible SQLAlchemy Core and ORM SELECTs skip the extra
LIMIT 0metadata query for empty results. Closes #1108 and #1134.
Bug Fixes
- Correct
Date32decoding before 1601 and in leap centuries such as 1600 and 2400. Nullable(Tuple(...))andNullable(Point)now read and insert correctly with the Python codec, including NULLs. Closes #1102 and #1104.pandas.Timestampkeeps nanoseconds inDateTime64(7..9)binds and inserts. Tuple, Nested, Map, and Variant parameters keepDateTime64precision. Related to #429.- Datetime parameters whose names end in
_64no longer fail withKeyErrorin pyformat queries. Closes #1131. - Large queries are no longer form-encoded automatically, which avoids
Field value too longerrors. Closes #1105. - NumPy and pandas reads:
LIMIT 0queries return empty results, object-column rows keep the correct shape, and numericLowCardinalitycolumns return every row. query_dfwithuse_none=Falseworks onNullable(Date)andNullable(Date32).- Async connection drops raise
OperationalErrororStreamFailureErrorinstead of leakingaiohttperrors. Mid-stream drops on both clients reportStreamFailureErrorand keep the original cause. AsyncClient.query(context=...)applies per-call arguments, andquery(context=...)runs a stored command statement.- Context
tz_modeis preserved across all query methods. - Enum names with backslashes or control characters parse and insert correctly. See #1117.
Decimal256(S)resolves to precision 76.- Fixes to timezone file handling, Tuple serialization error reporting,
Nullable(SimpleAggregateFunction)NULL inserts, and a C buffer crash on zero-length first reads.
Other
AsyncClient.raw_insertnow typesinsert_blockas an async iterable of bytes. Runtime behavior is unchanged.
Note for Python 3.14+
lz4 is no longer installed by default on Python 3.14 and later. In that case compress=True compresses inserts with zstd from the standard library. To keep using compress="lz4",install clickhouse-connect[lz4]. Nothing changes below 3.14.
Installation
pip install --upgrade clickhouse-connect
See the CHANGELOG for full details.