Release Candidate 1.0.0
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.0rc1
Important Migration Notes
Python Version: Minimum Python version is now 3.10. If you're on Python 3.9, pin to clickhouse-connect<1.0 or upgrade Python.
Timezone Handling: The pytz dependency has been replaced with the standard library zoneinfo. On Windows, tzdata is pulled in automatically. On slim Linux containers, install with pip install clickhouse-connect[tzdata].
Async Client: The executor-based async client has been removed. Use clickhouse_connect.get_async_client() for a native aiohttp-based client. Install with pip install clickhouse-connect[async].
Pandas: Minimum pandas version is now 2.0.
What's Changed
Breaking Changes
- Dropped Python 3.9 support. Minimum supported Python version is now 3.10. 0.15.x is the last series supporting Python 3.9.
- Dropped the
pytzdependency in favor of the standard libraryzoneinfo. On Windows,tzdatais pulled in automatically. On slim Linux containers without a system tzdb, installpip install clickhouse-connect[tzdata]. - Unknown timezone strings from
query_tz,column_tzs, or the server now surfacezoneinfo.ZoneInfoNotFoundErrorinternally (previouslypytz.exceptions.UnknownTimeZoneError). User-visibleProgrammingError/log messages suggest thetzdataextra. Closes #714. - Removed the deprecated
utc_tz_awareparameter entirely. Usetz_modeinstead:"naive_utc"(default, wasFalse),"aware"(wasTrue), or"schema"(unchanged). Closes #654, #665 - Removed the deprecated
apply_server_timezoneparameter entirely. Usetz_sourceinstead:"auto"(default),"server"(wasTrue), or"local"(wasFalse). - Remove the legacy executor-based async client. The
AsyncClient(client=...)constructor pattern,executor_threads, andexecutorparameters are no longer supported. Useclickhouse_connect.get_async_client()(orcreate_async_client()) which creates a native aiohttp-based async client directly. Thepool_mgrparameter is also rejected on the async path.aiohttpremains an optional dependency, installed viapip install clickhouse-connect[async]. - The internal
AiohttpAsyncClientclass has been renamed toAsyncClientand the moduleclickhouse_connect.driver.aiohttp_clienthas been removed. ImportAsyncClientfromclickhouse_connect.driveras before. - Dropped pandas 1.x support. Minimum pandas version is now 2.0. Users with pandas < 2.0 will get a
NotSupportedErrorat import time. Non-pandas usage is unaffected. Closes #661 - Removed the
preserve_pandas_datetime_resolutioncommon setting. Datetime columns now always return their natural resolution, e.g.datetime64[s]forDateTime,datetime64[ms]forDateTime64(3), instead of coercing everything todatetime64[ns]. Closes #662
Bug Fixes
- Fix Dynamic/JSON column reads when a path's inferred type sorts alphabetically after
"SharedVariant". ClickHouse'sDataTypeVariantconstructor sorts its members alphabetically by name, and discriminator bytes on the wire index into that sorted order. The client appendedSharedVariantto the variant list without sorting, so affected paths were read as the wrong variant. Closes #712 - Fix async streaming race condition that caused unhandled
InvalidStateErrorexceptions on early stream termination. When breaking out of an async stream early,shutdown()scheduled aset_resultcallback for pending futures viacall_soon_threadsafe, butTask.cancel()could cancel the future before the callback ran. The done-check is now deferred into the callback itself so it sees the actual future state at execution time. - SQLAlchemy: Wrap raw SQL strings in
text()inChClickHouseDialect.get_schema_names()andget_table_names(), soInspector.get_schema_names()andget_table_names()work on SQLAlchemy 2.x instead of raisingObjectNotExecutableError.
Improvements
- Package version is now exposed as
clickhouse_connect.__version__(a string), following Python packaging conventions. The version remains single-sourced fromclickhouse_connect/_version.py. Users can access version information viaclickhouse_connect.__version__,importlib.metadata.version("clickhouse-connect"), or theclickhouse_connect.common.version()helper. - Lazy loading of optional dependencies (
numpy,pandas,pyarrow,polars) now applies to the async client as well, matching the pattern established in 0.15.0 for the sync client. - Clearer error message when attempting to use the async client without aiohttp installed.
- The
generic_argsparameter is now properly parsed on the async client creation path, matching the sync client behavior. - Pandas 3.x compatibility. Removed deprecated
copy=Falseparameter fromSeries(),concat(), andastype()calls. Updated datetime insert path to use vectorized numpy conversion instead of element-by-element nanosecond arithmetic.
Development
- Replaced pylint with Ruff for linting and formatting. Double quotes are now the standard quote style. Bulk formatting commits are listed in
.git-blame-ignore-revs. CI lint job no longer requires building C extensions or installing project dependencies, significantly reducing lint check time.