Skip to content

Commit b508d23

Browse files
authored
Merge pull request #450 from ydb-platform/fix_drafts_import
Move draft imports to draft folder
2 parents c71f09c + a5bdfe8 commit b508d23

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

ydb/_apis.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
ydb_topic_v1_pb2_grpc,
1313
)
1414

15-
from ._grpc.v4.draft import (
16-
ydb_dynamic_config_v1_pb2_grpc,
17-
)
18-
1915
from ._grpc.v4.protos import (
2016
ydb_status_codes_pb2,
2117
ydb_discovery_pb2,
@@ -26,9 +22,6 @@
2622
ydb_common_pb2,
2723
)
2824

29-
from ._grpc.v4.draft.protos import (
30-
ydb_dynamic_config_pb2,
31-
)
3225
else:
3326
from ._grpc.common import (
3427
ydb_cms_v1_pb2_grpc,
@@ -39,10 +32,6 @@
3932
ydb_topic_v1_pb2_grpc,
4033
)
4134

42-
from ._grpc.common.draft import (
43-
ydb_dynamic_config_v1_pb2_grpc,
44-
)
45-
4635
from ._grpc.common.protos import (
4736
ydb_status_codes_pb2,
4837
ydb_discovery_pb2,
@@ -53,10 +42,6 @@
5342
ydb_common_pb2,
5443
)
5544

56-
from ._grpc.common.draft.protos import (
57-
ydb_dynamic_config_pb2,
58-
)
59-
6045

6146
StatusIds = ydb_status_codes_pb2.StatusIds
6247
FeatureFlag = ydb_common_pb2.FeatureFlag
@@ -66,7 +51,6 @@
6651
ydb_table = ydb_table_pb2
6752
ydb_discovery = ydb_discovery_pb2
6853
ydb_operation = ydb_operation_pb2
69-
ydb_dynamic_config = ydb_dynamic_config_pb2
7054

7155

7256
class CmsService(object):
@@ -127,12 +111,3 @@ class TopicService(object):
127111
DropTopic = "DropTopic"
128112
StreamRead = "StreamRead"
129113
StreamWrite = "StreamWrite"
130-
131-
132-
class DynamicConfigService(object):
133-
Stub = ydb_dynamic_config_v1_pb2_grpc.DynamicConfigServiceStub
134-
135-
ReplaceConfig = "ReplaceConfig"
136-
SetConfig = "SetConfig"
137-
GetConfig = "GetConfig"
138-
GetNodeLabels = "GetNodeLabels"

ydb/draft/_apis.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -*- coding: utf-8 -*-
2+
import typing
3+
4+
# Workaround for good IDE and universal for runtime
5+
if typing.TYPE_CHECKING:
6+
from .._grpc.v4.draft import (
7+
ydb_dynamic_config_v1_pb2_grpc,
8+
)
9+
10+
from .._grpc.v4.draft.protos import (
11+
ydb_dynamic_config_pb2,
12+
)
13+
else:
14+
from .._grpc.common.draft import (
15+
ydb_dynamic_config_v1_pb2_grpc,
16+
)
17+
18+
from .._grpc.common.draft.protos import (
19+
ydb_dynamic_config_pb2,
20+
)
21+
22+
23+
ydb_dynamic_config = ydb_dynamic_config_pb2
24+
25+
26+
class DynamicConfigService(object):
27+
Stub = ydb_dynamic_config_v1_pb2_grpc.DynamicConfigServiceStub
28+
29+
ReplaceConfig = "ReplaceConfig"
30+
SetConfig = "SetConfig"
31+
GetConfig = "GetConfig"
32+
GetNodeLabels = "GetNodeLabels"

ydb/draft/dynamic_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import abc
22
from abc import abstractmethod
3-
from .. import issues, operation, _apis
3+
from . import _apis
4+
from .. import issues, operation
45

56

67
class IDynamicConfigClient(abc.ABC):

0 commit comments

Comments
 (0)