Release Candidate 1.0.0 (rc2)
This is a release candidate for clickhouse-connect 1.0.0. Please test thoroughly with your workloads and report any issues before the final release.
Installation:
pip install clickhouse-connect==1.0.0rc2
If upgrading from 0.15.x, see the migration notes in rc1. All 1.0 breaking changes were introduced there. rc2 contains no new breaking changes.
Highlights
rc2 is primarily a performance release. There is order-of-magnitude faster DateTime/DateTime64 reads, Decimal reads, and fixed-width numpy inserts, plus significantly faster Map reads and writes.
What's Changed
Improvements
- Order-of-magnitude faster
DateTimeandDateTime64reads for naive UTC and UTC-equivalent timezones. The Cython read paths now decode via epoch arithmetic and constructdatetimeobjects directly via the CPython datetime C API, bypassingdatetime.fromtimestampand the Python-leveldatetime(...)constructor. Also fixes CythonDateTimeconversion bugs and expands epoch-arithmetic test coverage. - Significantly faster
Mapreads and writes. The read path avoids materializing an intermediate pair tuple. The write path moves into a new Cythonbuild_map_columnshelper. - Order-of-magnitude faster fixed-width numeric inserts from numpy arrays, with significantly lower peak memory. A new Cython
write_native_colhelper writes 1-D C-contiguous numpy arrays of matching dtype directly into the output buffer viamemcpy, avoiding the per-element conversion the previous path required. - Significantly faster
DecimalandBigDecimalreads. The decode path no longer constructs intermediate strings per row, building values directly from the integer column viaDecimal.scaleb.
Bug Fixes
- Async client: retry once when a pooled keep-alive connection is closed by the server and aiohttp raises
ServerDisconnectedErrorwith the default"Server disconnected"message. The existing retry path covered"Connection reset"and"Remote end closed", but not the bareServerDisconnectedError()produced by recent aiohttp versions, which surfaced as anOperationalError("Network Error: Server disconnected")on the first request after an idle period. - SQLAlchemy
Booltype now accepts and forwards**kwargsto the underlyingSqlaBooleanconstructor. SQLAlchemy'sSchemaTypemachinery passes internal kwargs (e.g.,_create_events) when copying or adapting the type during ORM model use orTable.to_metadata(), which previously raised aTypeError. Fixes #705 - SQLAlchemy:
CreateDatabasewithengine="Replicated"now emits a closing)after the(zoo_path, shard, replica)arguments, fixing previously invalid DDL on this path. The same arguments and thesystem.tableslookup inget_enginenow go through bound parameters and the existingformat_strhelper instead of raw f-string interpolation.