Skip to content

Commit 952f7b4

Browse files
gridnevvvitVitalii Gridnev
authored and
Vitalii Gridnev
committed
fix tests
1 parent dec0c40 commit 952f7b4

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__pycache__
2+
ydb.egg-info/

tests/aio/test_async_iter_stream.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def test_read_shard_table(driver, database):
6363

6464
data_by_shard_id = {}
6565
with session.transaction() as tx:
66-
max_value = 2 ** 64
66+
max_value = 2**64
6767
shard_key_bound = max_value >> 3
6868
data = []
6969

@@ -75,7 +75,7 @@ async def test_read_shard_table(driver, database):
7575
table_row = {
7676
"Key1": shard_id * shard_key_bound + idx,
7777
"Key2": idx + 1000,
78-
"Value": str(idx ** 4),
78+
"Value": str(idx**4),
7979
}
8080
data_by_shard_id[shard_id].append(table_row)
8181
data.append(table_row)

ydb/connection.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def _construct_channel_options(driver_config, endpoint_options=None):
176176
:param endpoint_options: Endpoint options
177177
:return: A channel initialization options
178178
"""
179-
_max_message_size = 64 * 10 ** 6
179+
_max_message_size = 64 * 10**6
180180
_default_connect_options = [
181181
("grpc.max_receive_message_length", _max_message_size),
182182
("grpc.max_send_message_length", _max_message_size),
@@ -269,7 +269,7 @@ def _cancel_callback(f):
269269
return self.rendezvous, self.result_future
270270

271271

272-
_nanos_in_second = 10 ** 9
272+
_nanos_in_second = 10**9
273273

274274

275275
def _set_duration(duration_value, seconds_float):

ydb/convert.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88

99
_SHIFT_BIT_COUNT = 64
10-
_SHIFT = 2 ** 64
11-
_SIGN_BIT = 2 ** 63
12-
_DecimalNanRepr = 10 ** 35 + 1
13-
_DecimalInfRepr = 10 ** 35
14-
_DecimalSignedInfRepr = -(10 ** 35)
10+
_SHIFT = 2**64
11+
_SIGN_BIT = 2**63
12+
_DecimalNanRepr = 10**35 + 1
13+
_DecimalInfRepr = 10**35
14+
_DecimalSignedInfRepr = -(10**35)
1515
_primitive_type_by_id = {}
1616

1717

@@ -49,7 +49,7 @@ def _pb_to_decimal(type_pb, value_pb, table_client_settings):
4949
elif int128_value == _DecimalSignedInfRepr:
5050
return decimal.Decimal("-Inf")
5151
return decimal.Decimal(int128_value) / decimal.Decimal(
52-
10 ** type_pb.decimal_type.scale
52+
10**type_pb.decimal_type.scale
5353
)
5454

5555

ydb/driver.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
import ydb
3-
42
from . import credentials as credentials_impl, table, scheme, pool
3+
from . import tracing
54
import six
65
import os
76

@@ -41,7 +40,7 @@ def parse_connection_string(connection_string):
4140

4241

4342
def default_credentials(credentials=None, tracer=None):
44-
tracer = tracer if tracer is not None else ydb.Tracer(None)
43+
tracer = tracer if tracer is not None else tracing.Tracer(None)
4544
with tracer.trace("Driver.default_credentials") as ctx:
4645
if credentials is not None:
4746
ctx.trace({"credentials.prepared": True})
@@ -158,7 +157,7 @@ def __init__(
158157
self.grpc_keep_alive_timeout = grpc_keep_alive_timeout
159158
self.table_client_settings = table_client_settings
160159
self.primary_user_agent = primary_user_agent
161-
self.tracer = tracer if tracer is not None else ydb.Tracer(None)
160+
self.tracer = tracer if tracer is not None else tracing.Tracer(None)
162161
self.grpc_lb_policy_name = grpc_lb_policy_name
163162
self.discovery_request_timeout = discovery_request_timeout
164163

ydb/ydb_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "1.1.15"
1+
VERSION = "2.1.0"

0 commit comments

Comments
 (0)