aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-10-15 07:22:39 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-10-15 07:31:13 +0300
commit5ebf8eb2724cd968a32372d2e6040fa024b3372d (patch)
tree8291f4f2cf6ebab6c366d1f5321d7b7f0c6bc2cd
parent7ccc5ead89ccb42306eadc974d5db82d1f830855 (diff)
downloadydb-5ebf8eb2724cd968a32372d2e6040fa024b3372d.tar.gz
Intermediate changes
commit_hash:4e8eadf6c73fa235953f526fe034e5035339c16f
-rw-r--r--contrib/python/clickhouse-connect/.dist-info/METADATA2
-rw-r--r--contrib/python/clickhouse-connect/clickhouse_connect/__version__.py2
-rw-r--r--contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py22
-rw-r--r--contrib/python/clickhouse-connect/ya.make2
4 files changed, 16 insertions, 12 deletions
diff --git a/contrib/python/clickhouse-connect/.dist-info/METADATA b/contrib/python/clickhouse-connect/.dist-info/METADATA
index 8ebbb2ace2..24f7a78836 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.0
+Version: 0.8.1
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 c5e4522a93..398cfc4c74 100644
--- a/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py
+++ b/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py
@@ -1 +1 @@
-version = '0.8.0'
+version = '0.8.1'
diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py b/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py
index 7dd73114e9..58b5460a59 100644
--- a/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py
+++ b/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py
@@ -207,13 +207,15 @@ class ResponseSource:
def lz_decompress(c: deque) -> Tuple[Optional[bytes], int]:
read_amt = 0
- while lz4_decom.needs_input:
- data = c.popleft()
- read_amt += len(data)
- if lz4_decom.unused_data:
- data = lz4_decom.unused_data + data
- return lz4_decom.decompress(data), read_amt
- return None, 0
+ data = c.popleft()
+ read_amt += len(data)
+ if lz4_decom.unused_data:
+ read_amt += len(lz4_decom.unused_data)
+ data = lz4_decom.unused_data + data
+ block = lz4_decom.decompress(data)
+ if lz4_decom.unused_data:
+ read_amt -= len(lz4_decom.unused_data)
+ return block, read_amt
decompress = lz_decompress
@@ -225,13 +227,15 @@ class ResponseSource:
current_size = 0
read_gen = response.read_chunked(chunk_size, decompress is None)
while True:
- while not done and current_size < buffer_size:
- chunk = next(read_gen, None)
+ while not done:
+ chunk = next(read_gen, None) # Always try to read at least one chunk if there are any left
if not chunk:
done = True
break
chunks.append(chunk)
current_size += len(chunk)
+ if current_size > buffer_size:
+ break
if len(chunks) == 0:
return
if decompress:
diff --git a/contrib/python/clickhouse-connect/ya.make b/contrib/python/clickhouse-connect/ya.make
index 467fc1f466..e594301105 100644
--- a/contrib/python/clickhouse-connect/ya.make
+++ b/contrib/python/clickhouse-connect/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(0.8.0)
+VERSION(0.8.1)
LICENSE(Apache-2.0)