diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-08-08 10:27:41 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-08-08 10:37:32 +0300 |
commit | bbaa4b454775bd56b2c24c3f08774c71f81ae404 (patch) | |
tree | 485d268e109446947f8aa628fd3f4188f9e9e691 /contrib | |
parent | d832a7c17b2662d436d9c68825ab8c656eef8742 (diff) | |
download | ydb-bbaa4b454775bd56b2c24c3f08774c71f81ae404.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib')
9 files changed, 19 insertions, 6 deletions
diff --git a/contrib/python/clickhouse-connect/.dist-info/METADATA b/contrib/python/clickhouse-connect/.dist-info/METADATA index 7a4ae1cbbf..b193a5722e 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.16 +Version: 0.7.17 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 d9a123ac6c..1e6e26e1df 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/__version__.py @@ -1 +1 @@ -version = '0.7.16' +version = '0.7.17' diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/common.py b/contrib/python/clickhouse-connect/clickhouse_connect/common.py index 0e4669c7e0..5e90d2dd75 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/common.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/common.py @@ -1,3 +1,4 @@ +import getpass import sys from dataclasses import dataclass from typing import Any, Sequence, Optional, Dict @@ -34,7 +35,12 @@ def build_client_name(client_name: str): product_name = product_name.strip() + ' ' if product_name else '' client_name = client_name.strip() + ' ' if client_name else '' py_version = sys.version.split(' ', maxsplit=1)[0] - return f'{client_name}{product_name}clickhouse-connect/{version()} (lv:py/{py_version}; os:{sys.platform})' + if get_setting('send_os_user'): + os_user = f'; os_user:{getpass.getuser()}' + else: + os_user = '' + return (f'{client_name}{product_name}clickhouse-connect/{version()}' + + f' (lv:py/{py_version}; mode:sync; os:{sys.platform}{os_user})') def get_setting(name: str): @@ -66,6 +72,7 @@ _init_common('invalid_setting_action', ('send', 'drop', 'error'), 'error') _init_common('max_connection_age', (), 10 * 60) # Max time in seconds to keep reusing a database TCP connection _init_common('product_name', (), '') # Product name used as part of client identification for ClickHouse query_log _init_common('readonly', (0, 1), 0) # Implied "read_only" ClickHouse settings for versions prior to 19.17 +_init_common('send_os_user', (True, False), True) # Use the client protocol version This is needed for DateTime timezone columns but breaks with current version of # chproxy diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/driver/asyncclient.py b/contrib/python/clickhouse-connect/clickhouse_connect/driver/asyncclient.py index 1a4ee7e429..e2dc5b0118 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/driver/asyncclient.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/driver/asyncclient.py @@ -5,6 +5,7 @@ from typing import Optional, Union, Dict, Any, Sequence, Iterable, Generator, Bi from clickhouse_connect.driver.client import Client from clickhouse_connect.driver.common import StreamContext +from clickhouse_connect.driver.httpclient import HttpClient from clickhouse_connect.driver.external import ExternalData from clickhouse_connect.driver.query import QueryContext, QueryResult from clickhouse_connect.driver.summary import QuerySummary @@ -20,8 +21,11 @@ class AsyncClient: """ def __init__(self, *, client: Client): + if isinstance(client, HttpClient): + client.headers['User-Agent'] = client.headers['User-Agent'].replace('mode:sync;', 'mode:async;') self.client = client + def set_client_setting(self, key, value): """ Set a clickhouse setting for the client after initialization. If a setting is not recognized by ClickHouse, diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/driver/client.py b/contrib/python/clickhouse-connect/clickhouse_connect/driver/client.py index 144c279da5..ba3873cbd8 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/driver/client.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/driver/client.py @@ -71,6 +71,7 @@ class Client(ABC): if apply_server_timezone is None: apply_server_timezone = dst_safe self.apply_server_timezone = apply_server_timezone == 'always' or coerce_bool(apply_server_timezone) + self.server_tz = server_tz except UnknownTimeZoneError: logger.warning('Warning, server is using an unrecognized timezone %s, will use UTC default', server_tz) diff --git a/contrib/python/clickhouse-connect/ya.make b/contrib/python/clickhouse-connect/ya.make index 72a6155ce2..ecbde2dd5d 100644 --- a/contrib/python/clickhouse-connect/ya.make +++ b/contrib/python/clickhouse-connect/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(0.7.16) +VERSION(0.7.17) LICENSE(Apache-2.0) diff --git a/contrib/python/importlib-metadata/py3/.dist-info/METADATA b/contrib/python/importlib-metadata/py3/.dist-info/METADATA index 691fb545bf..edd2ab879a 100644 --- a/contrib/python/importlib-metadata/py3/.dist-info/METADATA +++ b/contrib/python/importlib-metadata/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: importlib_metadata -Version: 8.1.0 +Version: 8.2.0 Summary: Read metadata from Python packages Author-email: "Jason R. Coombs" <jaraco@jaraco.com> Project-URL: Source, https://github.com/python/importlib_metadata diff --git a/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py b/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py index c973007992..655bdf80ae 100644 --- a/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py +++ b/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py @@ -38,6 +38,7 @@ __all__ = [ 'DistributionFinder', 'PackageMetadata', 'PackageNotFoundError', + 'SimplePath', 'distribution', 'distributions', 'entry_points', diff --git a/contrib/python/importlib-metadata/py3/ya.make b/contrib/python/importlib-metadata/py3/ya.make index 8e7b3102b3..705317eb97 100644 --- a/contrib/python/importlib-metadata/py3/ya.make +++ b/contrib/python/importlib-metadata/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(8.1.0) +VERSION(8.2.0) LICENSE(Apache-2.0) |