Skip to content

Commit 639e8b1

Browse files
committed
Merge branch 'main' into merge-from-main
# Conflicts: # ydb/_apis.py
2 parents eba948e + 6e42c28 commit 639e8b1

File tree

7 files changed

+79
-30
lines changed

7 files changed

+79
-30
lines changed

test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
attrs==21.2.0
22
bcrypt==3.2.0
3+
black==22.12.0
34
cached-property==1.5.2
45
certifi==2022.12.7
56
cffi==1.14.6

tox.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ deps =
4545

4646
[testenv:black-format]
4747
skip_install = true
48-
deps = black
4948
commands =
5049
black ydb examples tests --extend-exclude ydb/_grpc
5150

5251
[testenv:black]
5352
skip_install = true
54-
deps = black
5553
commands =
5654
black --diff --check ydb examples tests --extend-exclude ydb/_grpc
5755

ydb/_apis.py

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
11
# -*- coding: utf-8 -*-
2-
from ydb._grpc.common import (
3-
ydb_cms_v1_pb2_grpc,
4-
ydb_discovery_v1_pb2_grpc,
5-
ydb_scheme_v1_pb2_grpc,
6-
ydb_table_v1_pb2_grpc,
7-
)
8-
from ydb._grpc.common.protos import (
9-
ydb_status_codes_pb2,
10-
ydb_discovery_pb2,
11-
ydb_scheme_pb2,
12-
ydb_table_pb2,
13-
ydb_value_pb2,
14-
)
15-
from ydb._grpc.common.protos import ydb_operation_pb2
16-
from ydb._grpc.common.protos import ydb_common_pb2
17-
from ydb._grpc.common import ydb_operation_v1_pb2_grpc
18-
19-
# Workaround for good IDE and universal runtime
2+
# Workaround for good IDE and universal for runtime
3+
# noinspection PyUnreachableCode
204
if False:
21-
from ydb._grpc.v4 import ydb_topic_v1_pb2_grpc
5+
from ._grpc.v4 import (
6+
ydb_cms_v1_pb2_grpc,
7+
ydb_discovery_v1_pb2_grpc,
8+
ydb_scheme_v1_pb2_grpc,
9+
ydb_table_v1_pb2_grpc,
10+
ydb_operation_v1_pb2_grpc,
11+
ydb_topic_v1_pb2_grpc,
12+
)
13+
14+
from ._grpc.v4.protos import (
15+
ydb_status_codes_pb2,
16+
ydb_discovery_pb2,
17+
ydb_scheme_pb2,
18+
ydb_table_pb2,
19+
ydb_value_pb2,
20+
ydb_operation_pb2,
21+
ydb_common_pb2,
22+
)
2223
else:
23-
from ydb._grpc.common import ydb_topic_v1_pb2_grpc
24+
from ._grpc.common import (
25+
ydb_cms_v1_pb2_grpc,
26+
ydb_discovery_v1_pb2_grpc,
27+
ydb_scheme_v1_pb2_grpc,
28+
ydb_table_v1_pb2_grpc,
29+
ydb_operation_v1_pb2_grpc,
30+
ydb_topic_v1_pb2_grpc,
31+
)
32+
33+
from ._grpc.common.protos import (
34+
ydb_status_codes_pb2,
35+
ydb_discovery_pb2,
36+
ydb_scheme_pb2,
37+
ydb_table_pb2,
38+
ydb_value_pb2,
39+
ydb_operation_pb2,
40+
ydb_common_pb2,
41+
)
2442

2543

2644
StatusIds = ydb_status_codes_pb2.StatusIds

ydb/credentials.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
from concurrent import futures
88
import logging
99
import time
10-
from ydb._grpc.common.protos import ydb_auth_pb2
11-
from ydb._grpc.common import ydb_auth_v1_pb2_grpc
10+
11+
# Workaround for good IDE and universal for runtime
12+
# noinspection PyUnreachableCode
13+
if False:
14+
from ._grpc.v4.protos import ydb_auth_pb2
15+
from ._grpc.v4 import ydb_auth_v1_pb2_grpc
16+
else:
17+
from ._grpc.common.protos import ydb_auth_pb2
18+
from ._grpc.common import ydb_auth_v1_pb2_grpc
1219

1320

1421
YDB_AUTH_TICKET_HEADER = "x-ydb-auth-ticket"

ydb/export.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
from . import _apis
44

55
from . import settings_impl as s_impl
6-
from ydb._grpc.common.protos import ydb_export_pb2
7-
from ydb._grpc.common import ydb_export_v1_pb2_grpc
6+
7+
# Workaround for good IDE and universal for runtime
8+
# noinspection PyUnreachableCode
9+
if False:
10+
from ._grpc.v4.protos import ydb_export_pb2
11+
from ._grpc.v4 import ydb_export_v1_pb2_grpc
12+
else:
13+
from ._grpc.common.protos import ydb_export_pb2
14+
from ._grpc.common import ydb_export_v1_pb2_grpc
15+
816
from . import operation
917

1018
_ExportToYt = "ExportToYt"

ydb/import_client.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33
from . import _apis
44

55
from . import settings_impl as s_impl
6-
from ydb._grpc.common.protos import ydb_import_pb2
7-
from ydb._grpc.common import ydb_import_v1_pb2_grpc
6+
7+
# Workaround for good IDE and universal for runtime
8+
# noinspection PyUnreachableCode
9+
if False:
10+
from ._grpc.v4.protos import ydb_import_pb2
11+
from ._grpc.v4 import ydb_import_v1_pb2_grpc
12+
else:
13+
from ._grpc.common.protos import ydb_import_pb2
14+
from ._grpc.common import ydb_import_v1_pb2_grpc
15+
16+
817
from . import operation
918

1019
_ImportFromS3 = "ImportFromS3"

ydb/scripting.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
from ydb._grpc.common.protos import ydb_scripting_pb2
2-
from ydb._grpc.common import ydb_scripting_v1_pb2_grpc
1+
# Workaround for good IDE and universal for runtime
2+
# noinspection PyUnreachableCode
3+
if False:
4+
from ._grpc.v4.protos import ydb_scripting_pb2
5+
from ._grpc.v4 import ydb_scripting_v1_pb2_grpc
6+
else:
7+
from ._grpc.common.protos import ydb_scripting_pb2
8+
from ._grpc.common import ydb_scripting_v1_pb2_grpc
9+
10+
311
from . import issues, convert, settings
412

513

0 commit comments

Comments
 (0)