Skip to content

Commit c6ce18a

Browse files
authored
Merge pull request #16 from gridnevvvit/fix-tests
fix tests
2 parents 58d9e09 + bf8eaff commit c6ce18a

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

.github/workflows/main.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Python package
22

3-
on: [push]
3+
on:
4+
push:
5+
pull_request:
46

57
jobs:
68
build:

.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-7
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})
@@ -117,7 +116,6 @@ def __init__(
117116
grpc_lb_policy_name="round_robin",
118117
discovery_request_timeout=10,
119118
):
120-
# type:(str, str, str, str, Any, ydb.Credentials, bool, bytes, bytes, bytes, float, ydb.TableClientSettings, list, str, ydb.Tracer) -> None
121119
"""
122120
A driver config to initialize a driver instance
123121
@@ -158,7 +156,7 @@ def __init__(
158156
self.grpc_keep_alive_timeout = grpc_keep_alive_timeout
159157
self.table_client_settings = table_client_settings
160158
self.primary_user_agent = primary_user_agent
161-
self.tracer = tracer if tracer is not None else ydb.Tracer(None)
159+
self.tracer = tracer if tracer is not None else tracing.Tracer(None)
162160
self.grpc_lb_policy_name = grpc_lb_policy_name
163161
self.discovery_request_timeout = discovery_request_timeout
164162

@@ -235,8 +233,6 @@ def __init__(
235233
credentials=None,
236234
**kwargs
237235
):
238-
# type:(DriverConfig, str, str, str, bytes, ydb.AbstractCredentials, **Any) -> None
239-
240236
"""
241237
Constructs a driver instance to be used in table and scheme clients.
242238
It encapsulates endpoints discovery mechanism and provides ability to execute RPCs

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)