diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-12-12 12:15:38 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-12-12 12:33:01 +0300 |
commit | 8093553f5735b27c84bab0334f1150d325766268 (patch) | |
tree | 870d6fad9a00d78f21720ebd87c8b3269cc82457 | |
parent | 2d0c60e47bba82c22f72db462f105b285ed6d524 (diff) | |
download | ydb-8093553f5735b27c84bab0334f1150d325766268.tar.gz |
Intermediate changes
commit_hash:bc06c484f338fad20592168fcb8b4321711dd90c
7 files changed, 13 insertions, 13 deletions
diff --git a/contrib/python/clickhouse-connect/.dist-info/METADATA b/contrib/python/clickhouse-connect/.dist-info/METADATA index 2c5f8da23f..3d5428f0c5 100644 --- a/contrib/python/clickhouse-connect/.dist-info/METADATA +++ b/contrib/python/clickhouse-connect/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: clickhouse-connect -Version: 0.8.7 +Version: 0.8.8 Summary: ClickHouse Database Core Driver for Python, Pandas, and Superset Home-page: https://github.com/ClickHouse/clickhouse-connect Author: ClickHouse Inc. diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py b/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py index 5cc50020e8..0c10f92064 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py @@ -1 +1 @@ -version = '0.8.7' +version = '0.8.8' diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/datatypes/temporal.py b/contrib/python/clickhouse-connect/clickhouse_connect/datatypes/temporal.py index 6359d5ba55..49899fb7c1 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/datatypes/temporal.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/datatypes/temporal.py @@ -79,7 +79,6 @@ class Date32(Date): return data_conv.read_date32_col(source, num_rows) -from_ts_naive = datetime.utcfromtimestamp from_ts_tz = datetime.fromtimestamp @@ -193,7 +192,7 @@ class DateTime64(DateTimeBase): def _read_binary_naive(self, column: Sequence): new_col = [] app = new_col.append - dt_from = datetime.utcfromtimestamp + dt_from = datetime.fromtimestamp prec = self.prec for ticks in column: seconds = ticks // prec diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/driver/dataconv.py b/contrib/python/clickhouse-connect/clickhouse_connect/driver/dataconv.py index 5acc49830e..fc2720128d 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/driver/dataconv.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/driver/dataconv.py @@ -28,9 +28,6 @@ def read_ipv4_col(source: ByteSource, num_rows: int): def read_datetime_col(source: ByteSource, num_rows: int, tz_info: Optional[tzinfo]): src_array = source.read_array('I', num_rows) - if tz_info is None: - fts = datetime.utcfromtimestamp - return [fts(ts) for ts in src_array] fts = datetime.fromtimestamp return [fts(ts, tz_info) for ts in src_array] diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py b/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py index deb68ce05c..859c7d88ba 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py @@ -228,7 +228,12 @@ class ResponseSource: read_gen = response.stream(chunk_size, decompress is None) while True: while not done: - chunk = next(read_gen, None) # Always try to read at least one chunk if there are any left + try: + chunk = next(read_gen, None) # Always try to read at least one chunk if there are any left + except Exception: # pylint: disable=broad-except + # By swallowing an unexpected exception reading the stream, we will let consumers decide how to + # handle the unexpected end of stream + pass if not chunk: done = True break diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/tools/datagen.py b/contrib/python/clickhouse-connect/clickhouse_connect/tools/datagen.py index 490d852916..755f3df98e 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/tools/datagen.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/tools/datagen.py @@ -18,8 +18,7 @@ from clickhouse_connect.datatypes.string import String, FixedString from clickhouse_connect.datatypes.temporal import Date, Date32, DateTime, DateTime64 from clickhouse_connect.driver.common import array_sizes -dt_from_ts = datetime.utcfromtimestamp -dt_from_ts_tz = datetime.fromtimestamp +dt_from_ts = datetime.fromtimestamp epoch_date = date(1970, 1, 1) date32_start_date = date(1925, 1, 1) @@ -138,7 +137,7 @@ def random_datetime(): def random_datetime_tz(timezone: tzinfo): - return dt_from_ts_tz(int(random() * 2 ** 32), timezone).replace(microsecond=0) + return dt_from_ts(int(random() * 2 ** 32), timezone).replace(microsecond=0) def random_ascii_str(max_len: int = 200, min_len: int = 0): @@ -172,7 +171,7 @@ def random_datetime64_tz(prec: int, timezone: tzinfo): u_sec = int(random() * 1000) * 1000 else: u_sec = int(random() * 1000000) - return dt_from_ts_tz(int(random() * 4294967296), timezone).replace(microsecond=u_sec) + return dt_from_ts(int(random() * 4294967296), timezone).replace(microsecond=u_sec) def random_ipv6(): diff --git a/contrib/python/clickhouse-connect/ya.make b/contrib/python/clickhouse-connect/ya.make index 2f0e645111..0f490a7dbc 100644 --- a/contrib/python/clickhouse-connect/ya.make +++ b/contrib/python/clickhouse-connect/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(0.8.7) +VERSION(0.8.8) LICENSE(Apache-2.0) |