Skip to content

Commit ab5c8d6

Browse files
committed
Intermediate changes
commit_hash:36f6f3674eaf6f39f4347c79c0086dbcb43d6f27
1 parent d9a31c5 commit ab5c8d6

File tree

8 files changed

+38
-28
lines changed

8 files changed

+38
-28
lines changed

contrib/python/argcomplete/py3/.dist-info/METADATA

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: argcomplete
3-
Version: 3.5.0
3+
Version: 3.5.1
44
Summary: Bash tab completion for argparse
55
Home-page: https://github.com/kislyuk/argcomplete
66
Author: Andrey Kislyuk
@@ -9,7 +9,7 @@ License: Apache Software License
99
Project-URL: Documentation, https://kislyuk.github.io/argcomplete
1010
Project-URL: Source Code, https://github.com/kislyuk/argcomplete
1111
Project-URL: Issue Tracker, https://github.com/kislyuk/argcomplete/issues
12-
Project-URL: Change Log, https://github.com/kislyuk/argcomplete/blob/master/Changes.rst
12+
Project-URL: Change Log, https://github.com/kislyuk/argcomplete/blob/develop/Changes.rst
1313
Platform: MacOS X
1414
Platform: Posix
1515
Classifier: Environment :: Console

contrib/python/argcomplete/py3/argcomplete/packages/_argparse.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ def take_action(action, argument_strings, option_string=None):
162162
def consume_optional(start_index):
163163
# get the optional identified at this index
164164
option_tuple = option_string_indices[start_index]
165+
if isinstance(option_tuple, list): # Python 3.12.7+
166+
option_tuple = option_tuple[0]
165167
if len(option_tuple) == 3:
166168
action, option_string, explicit_arg = option_tuple
167169
else: # Python 3.11.9+, 3.12.3+, 3.13+

contrib/python/argcomplete/py3/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PY3_LIBRARY()
44

5-
VERSION(3.5.0)
5+
VERSION(3.5.1)
66

77
LICENSE(Apache-2.0)
88

contrib/python/clickhouse-connect/.dist-info/METADATA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: clickhouse-connect
3-
Version: 0.8.2
3+
Version: 0.8.3
44
Summary: ClickHouse Database Core Driver for Python, Pandas, and Superset
55
Home-page: https://github.com/ClickHouse/clickhouse-connect
66
Author: ClickHouse Inc.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '0.8.2'
1+
version = '0.8.3'

contrib/python/clickhouse-connect/clickhouse_connect/driver/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ async def create_async_client(*,
133133
dsn: Optional[str] = None,
134134
settings: Optional[Dict[str, Any]] = None,
135135
generic_args: Optional[Dict[str, Any]] = None,
136+
executor_threads: Optional[int] = None,
136137
**kwargs) -> AsyncClient:
137138
"""
138139
The preferred method to get an async ClickHouse Connect Client instance.
@@ -154,6 +155,8 @@ async def create_async_client(*,
154155
:param settings: ClickHouse server settings to be used with the session/every request
155156
:param generic_args: Used internally to parse DBAPI connection strings into keyword arguments and ClickHouse settings.
156157
It is not recommended to use this parameter externally
158+
:param: executor_threads 'max_worker' threads used by the client ThreadPoolExecutor. If not set, the default
159+
of 4 + detected CPU cores will be used
157160
:param kwargs -- Recognized keyword arguments (used by the HTTP client), see below
158161
159162
:param compress: Enable compression for ClickHouse HTTP inserts and query results. True will select the preferred
@@ -194,4 +197,4 @@ def _create_client():
194197

195198
loop = asyncio.get_running_loop()
196199
_client = await loop.run_in_executor(None, _create_client)
197-
return AsyncClient(client=_client)
200+
return AsyncClient(client=_client, executor_threads=executor_threads)

contrib/python/clickhouse-connect/clickhouse_connect/driver/asyncclient.py

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import asyncio
22
import io
3+
import os
4+
from concurrent.futures.thread import ThreadPoolExecutor
35
from datetime import tzinfo
46
from typing import Optional, Union, Dict, Any, Sequence, Iterable, Generator, BinaryIO
57

@@ -20,10 +22,13 @@ class AsyncClient:
2022
Internally, each of the methods that uses IO is wrapped in a call to EventLoop.run_in_executor.
2123
"""
2224

23-
def __init__(self, *, client: Client):
25+
def __init__(self, *, client: Client, executor_threads: int = 0):
2426
if isinstance(client, HttpClient):
2527
client.headers['User-Agent'] = client.headers['User-Agent'].replace('mode:sync;', 'mode:async;')
2628
self.client = client
29+
if executor_threads == 0:
30+
executor_threads = min(32, (os.cpu_count() or 1) + 4) # Mimic the default behavior
31+
self.executor = ThreadPoolExecutor(max_workers=executor_threads)
2732

2833

2934
def set_client_setting(self, key, value):
@@ -88,7 +93,7 @@ def _query():
8893
external_data=external_data)
8994

9095
loop = asyncio.get_running_loop()
91-
result = await loop.run_in_executor(None, _query)
96+
result = await loop.run_in_executor(self.executor, _query)
9297
return result
9398

9499
async def query_column_block_stream(self,
@@ -117,7 +122,7 @@ def _query_column_block_stream():
117122
external_data=external_data)
118123

119124
loop = asyncio.get_running_loop()
120-
result = await loop.run_in_executor(None, _query_column_block_stream)
125+
result = await loop.run_in_executor(self.executor, _query_column_block_stream)
121126
return result
122127

123128
async def query_row_block_stream(self,
@@ -146,7 +151,7 @@ def _query_row_block_stream():
146151
external_data=external_data)
147152

148153
loop = asyncio.get_running_loop()
149-
result = await loop.run_in_executor(None, _query_row_block_stream)
154+
result = await loop.run_in_executor(self.executor, _query_row_block_stream)
150155
return result
151156

152157
async def query_rows_stream(self,
@@ -175,7 +180,7 @@ def _query_rows_stream():
175180
external_data=external_data)
176181

177182
loop = asyncio.get_running_loop()
178-
result = await loop.run_in_executor(None, _query_rows_stream)
183+
result = await loop.run_in_executor(self.executor, _query_rows_stream)
179184
return result
180185

181186
async def raw_query(self,
@@ -202,7 +207,7 @@ def _raw_query():
202207
use_database=use_database, external_data=external_data)
203208

204209
loop = asyncio.get_running_loop()
205-
result = await loop.run_in_executor(None, _raw_query)
210+
result = await loop.run_in_executor(self.executor, _raw_query)
206211
return result
207212

208213
async def raw_stream(self, query: str,
@@ -228,7 +233,7 @@ def _raw_stream():
228233
use_database=use_database, external_data=external_data)
229234

230235
loop = asyncio.get_running_loop()
231-
result = await loop.run_in_executor(None, _raw_stream)
236+
result = await loop.run_in_executor(self.executor, _raw_stream)
232237
return result
233238

234239
async def query_np(self,
@@ -255,7 +260,7 @@ def _query_np():
255260
external_data=external_data)
256261

257262
loop = asyncio.get_running_loop()
258-
result = await loop.run_in_executor(None, _query_np)
263+
result = await loop.run_in_executor(self.executor, _query_np)
259264
return result
260265

261266
async def query_np_stream(self,
@@ -282,7 +287,7 @@ def _query_np_stream():
282287
context=context, external_data=external_data)
283288

284289
loop = asyncio.get_running_loop()
285-
result = await loop.run_in_executor(None, _query_np_stream)
290+
result = await loop.run_in_executor(self.executor, _query_np_stream)
286291
return result
287292

288293
async def query_df(self,
@@ -314,7 +319,7 @@ def _query_df():
314319
external_data=external_data, use_extended_dtypes=use_extended_dtypes)
315320

316321
loop = asyncio.get_running_loop()
317-
result = await loop.run_in_executor(None, _query_df)
322+
result = await loop.run_in_executor(self.executor, _query_df)
318323
return result
319324

320325
async def query_df_stream(self,
@@ -347,7 +352,7 @@ def _query_df_stream():
347352
external_data=external_data, use_extended_dtypes=use_extended_dtypes)
348353

349354
loop = asyncio.get_running_loop()
350-
result = await loop.run_in_executor(None, _query_df_stream)
355+
result = await loop.run_in_executor(self.executor, _query_df_stream)
351356
return result
352357

353358
def create_query_context(self,
@@ -433,7 +438,7 @@ def _query_arrow():
433438
use_strings=use_strings, external_data=external_data)
434439

435440
loop = asyncio.get_running_loop()
436-
result = await loop.run_in_executor(None, _query_arrow)
441+
result = await loop.run_in_executor(self.executor, _query_arrow)
437442
return result
438443

439444
async def query_arrow_stream(self,
@@ -457,7 +462,7 @@ def _query_arrow_stream():
457462
use_strings=use_strings, external_data=external_data)
458463

459464
loop = asyncio.get_running_loop()
460-
result = await loop.run_in_executor(None, _query_arrow_stream)
465+
result = await loop.run_in_executor(self.executor, _query_arrow_stream)
461466
return result
462467

463468
async def command(self,
@@ -486,7 +491,7 @@ def _command():
486491
use_database=use_database, external_data=external_data)
487492

488493
loop = asyncio.get_running_loop()
489-
result = await loop.run_in_executor(None, _command)
494+
result = await loop.run_in_executor(self.executor, _command)
490495
return result
491496

492497
async def ping(self) -> bool:
@@ -499,7 +504,7 @@ def _ping():
499504
return self.client.ping()
500505

501506
loop = asyncio.get_running_loop()
502-
result = await loop.run_in_executor(None, _ping)
507+
result = await loop.run_in_executor(self.executor, _ping)
503508
return result
504509

505510
async def insert(self,
@@ -537,7 +542,7 @@ def _insert():
537542
column_oriented=column_oriented, settings=settings, context=context)
538543

539544
loop = asyncio.get_running_loop()
540-
result = await loop.run_in_executor(None, _insert)
545+
result = await loop.run_in_executor(self.executor, _insert)
541546
return result
542547

543548
async def insert_df(self, table: str = None,
@@ -572,7 +577,7 @@ def _insert_df():
572577
context=context)
573578

574579
loop = asyncio.get_running_loop()
575-
result = await loop.run_in_executor(None, _insert_df)
580+
result = await loop.run_in_executor(self.executor, _insert_df)
576581
return result
577582

578583
async def insert_arrow(self, table: str,
@@ -591,7 +596,7 @@ def _insert_arrow():
591596
return self.client.insert_arrow(table=table, arrow_table=arrow_table, database=database, settings=settings)
592597

593598
loop = asyncio.get_running_loop()
594-
result = await loop.run_in_executor(None, _insert_arrow)
599+
result = await loop.run_in_executor(self.executor, _insert_arrow)
595600
return result
596601

597602
async def create_insert_context(self,
@@ -625,7 +630,7 @@ def _create_insert_context():
625630
column_oriented=column_oriented, settings=settings, data=data)
626631

627632
loop = asyncio.get_running_loop()
628-
result = await loop.run_in_executor(None, _create_insert_context)
633+
result = await loop.run_in_executor(self.executor, _create_insert_context)
629634
return result
630635

631636
async def data_insert(self, context: InsertContext) -> QuerySummary:
@@ -639,7 +644,7 @@ def _data_insert():
639644
return self.client.data_insert(context=context)
640645

641646
loop = asyncio.get_running_loop()
642-
result = await loop.run_in_executor(None, _data_insert)
647+
result = await loop.run_in_executor(self.executor, _data_insert)
643648
return result
644649

645650
async def raw_insert(self, table: str,
@@ -663,5 +668,5 @@ def _raw_insert():
663668
settings=settings, fmt=fmt, compression=compression)
664669

665670
loop = asyncio.get_running_loop()
666-
result = await loop.run_in_executor(None, _raw_insert)
671+
result = await loop.run_in_executor(self.executor, _raw_insert)
667672
return result

contrib/python/clickhouse-connect/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PY3_LIBRARY()
44

5-
VERSION(0.8.2)
5+
VERSION(0.8.3)
66

77
LICENSE(Apache-2.0)
88

0 commit comments

Comments
 (0)