diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-03-29 09:33:24 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-03-29 09:42:32 +0300 |
commit | bc252a2deca02a342c35fcee243369a761c4f3d4 (patch) | |
tree | b8bbbcf6aa4422c4976fd84c09ff80c3488df416 /contrib/python/clickhouse-connect | |
parent | a21f8f835e55425029f398bd3c1829b01c82f3c8 (diff) | |
download | ydb-bc252a2deca02a342c35fcee243369a761c4f3d4.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python/clickhouse-connect')
4 files changed, 12 insertions, 4 deletions
diff --git a/contrib/python/clickhouse-connect/.dist-info/METADATA b/contrib/python/clickhouse-connect/.dist-info/METADATA index 9564d0f52c..9b873eb781 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.7.2 +Version: 0.7.3 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 9e69f101cf..0ab8b1bafd 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py @@ -1 +1 @@ -version = '0.7.2' +version = '0.7.3' diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/dbapi/cursor.py b/contrib/python/clickhouse-connect/clickhouse_connect/dbapi/cursor.py index b8f23452ac..64eabcba34 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/dbapi/cursor.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/dbapi/cursor.py @@ -1,7 +1,7 @@ import logging import re -from typing import Optional, Sequence +from typing import Optional, Sequence, List, Dict from clickhouse_connect.datatypes.registry import get_from_name from clickhouse_connect.driver.common import unescape_identifier @@ -17,6 +17,7 @@ str_type = get_from_name('String') int_type = get_from_name('Int32') +# pylint: disable=too-many-instance-attributes class Cursor: """ See :ref:`https://peps.python.org/pep-0249/` @@ -29,6 +30,7 @@ class Cursor: self.names = [] self.types = [] self._rowcount = 0 + self._summary: List[Dict[str, str]] = [] self._ix = 0 def check_valid(self): @@ -43,6 +45,10 @@ class Cursor: def rowcount(self): return self._rowcount + @property + def summary(self) -> List[Dict[str, str]]: + return self._summary + def close(self): self.data = None @@ -50,6 +56,7 @@ class Cursor: query_result = self.client.query(operation, parameters) self.data = query_result.result_set self._rowcount = len(self.data) + self._summary.append(query_result.summary) if query_result.column_names: self.names = query_result.column_names self.types = [x.name for x in query_result.column_types] @@ -94,6 +101,7 @@ class Cursor: else: self.names = query_result.column_names self.types = query_result.column_types + self._summary.append(query_result.summary) except TypeError as ex: raise ProgrammingError(f'Invalid parameters {parameters} passed to cursor executemany') from ex self._rowcount = len(self.data) diff --git a/contrib/python/clickhouse-connect/ya.make b/contrib/python/clickhouse-connect/ya.make index 40daa9fa20..d082921604 100644 --- a/contrib/python/clickhouse-connect/ya.make +++ b/contrib/python/clickhouse-connect/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(0.7.2) +VERSION(0.7.3) LICENSE(Apache-2.0) |