Clickhouse-connect

Latest version: v0.7.14

Safety actively analyzes 641049 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 9 of 16

0.5.17

Timezone Improvements
- The client `query_df` and `query_df_stream` methods now accept `query_tz` and `column_tzs` parameters like other
`query*` methods.
- A new boolean parameter `apply_server_timezone` has been added to the main `get_client` method. Setting this
parameter to `True` (the default) will apply the server timezone (if not UTC) to values returned by the client `query*`
methods. The previous behavior would always return timezone naive, UTC based Python and Pandas `datetime` objects for
ClickHouse DateTime and DateTime64 columns without a defined timezone. To revert to the previous behavior, set the
`apply_server_timezone` parameter to `False`. Closes https://github.com/ClickHouse/clickhouse-connect/issues/152
- The timezone logic applied to query results has been simplified and now uses the following order of precedence:
- Use the column timezone for the column if it is specified using the `column_tzs` parameter
- Use the column timezone for the column if specified in the ClickHouse column definition (only works for ClickHouse versions 23.2 and later)
- Use the query timezone for the query if it is set using the `query_tz` parameter
- Use the "response" timezone for the query as read from the `X-ClickHouse-Timezone` header if different from the server timezone. This closes https://github.com/ClickHouse/clickhouse-connect/issues/138.
- Use the ClickHouse server timezone (if the client parameter `apply_server_timezone` is `True`)
- Note if the detected timezone according to the above precedence is UTC, `clickhouse-connect` will always return a naive datetime object with no timezone information

New Feature
- ClickHouse external data is now support for all client `query` methods. To send external data, construct a `driver.external.ExternalData` object and
send it as the `external_data` parameter in the appropriate query method. See the [ClickHouse documentation](https://clickhouse.com/docs/en/engines/table-engines/special/external-data)
for additional details. There are also examples in the [test file ](https://github.com/ClickHouse/clickhouse-connect/blob/main/tests/integration_tests/test_external_data.py).
Closes https://github.com/ClickHouse/clickhouse-connect/issues/98

0.5.16

Bug Fix
- Creating a client would fail if for some reason the user did not have access to the `system.settings` table. Thanks
to [Filipp Balakin](https://github.com/Barsoomx) for the fix.

Improvements
- String columns now accept values of bytes-like objects (bytes/bytearray/etc.) for inserts (as with other inserts, all
values for the inserted column should be the same types, either a bytes-like object or `str`). A corresponding `bytes`
read format has been enabled for String columns as well. Thanks to [Tim Nooran](https://github.com/TimNooren) for opening
the issue and providing unit tests. https://github.com/ClickHouse/clickhouse-connect/issues/148
- Cython version upgraded to 3.0.0b1

0.5.15

Bug Fix
- Remove unnecessary addition of the client database to the table name for inserts. Fixes
https://github.com/ClickHouse/clickhouse-connect/issues/145

Improvement
- The driver should now work for older versions of ClickHouse back to 19.16. Note that older versions are not
officially tested or supported (like the main ClickHouse database, we officially support the last three monthly ClickHouse
releases and the last two LTS ClickHouse releases). For versions prior to 19.17, you may want change the new `readonly`
`clickhouse_connect.common` setting to '1' to allow sending ClickHouse settings with individual queries (if the user has
write permissions). Thanks to [Aleksey Astafiev](https://github.com/aastafiev) for this contribution and for
updating the tests to run with these legacy versions!

0.5.14

Bug Fix
- Remove direct pandas import that caused an unrecoverable error when pandas was not installed.
https://github.com/ClickHouse/clickhouse-connect/issues/139

0.5.13

Improvements
- By default, reading Pandas Dataframes with query_df and query_df_stream now sets a new QueryContext property
of `use_pandas_na` to `True`. When `use_pandas_na` is True, clickhouse_connect will attempt to use Pandas "missing"
values, such as pandas.NaT and pandas.NA, for ClickHouse NULLs (in Nullable columns only), and use the associated
extended Pandas dtype. Closes https://github.com/ClickHouse/clickhouse-connect/issues/132
- There are new low level optimizations for reading some Nullable columns, and writing Pandas dataframes

Bug Fixes
- Timezone information from ClickHouse DateTime columns with a timezone was lost. There was a workaround implemented
for this issue in v0.5.8 that allowed assigned timezones to the query or columns on the client side. ClickHouse now
support sending this timezone data with the column, but only in server versions 23.2 and later. If such a version is
detected, clickhouse-connect will return timezone aware DateTime values without a workaround. Fixes
https://github.com/ClickHouse/clickhouse-connect/issues/120
- For certain queries, an incorrect, non-zero "zero value" would be returned for queries where `use_none` was set
to `False`. All NULL values are now properly converted.
- Timezone data was lost when a DateTime64 column with a timezone was converted to a Pandas DataFrame. This has been
fixed. https://github.com/ClickHouse/clickhouse-connect/issues/136
- send_progress headers were not being correctly requested, which could result in unexpected timeouts for long-running
queries. This has been fixed.

0.5.12

Improvement
- A new keyword parameter `server_host_name` is now recognized by the `clickhouse_connect.get_client` method. This identifies
the "real" ClickHouse server hostname that should be used for HTTPS/TLS certificate validation, in cases where access to
the server is through an ssh tunnel or other proxy with a different hostname. For examples of how to use the new parameter,
see the updated file https://github.com/ClickHouse/clickhouse-connect/blob/main/examples/ssh_tunnels.py.

Bug fix
- The `database` element of a DSN was not recognized when present in the `dsn` parameter of `clickhouse_connect.get_client`.
This has been fixed.

Page 9 of 16

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.