diff --git a/ydb/_grpc/common/__init__.py b/ydb/_grpc/common/__init__.py index 3b56178b..bab864e0 100644 --- a/ydb/_grpc/common/__init__.py +++ b/ydb/_grpc/common/__init__.py @@ -10,7 +10,15 @@ protobuf_version = Version(google.protobuf.__version__) # for compatible with arcadia -if _utilities.check_module_exists("ydb.public.api"): +if _utilities.check_module_exists("contrib.ydb.public.api"): + from contrib.ydb.public.api.grpc import * # noqa + + sys.modules["ydb._grpc.common"] = sys.modules["contrib.ydb.public.api.grpc"] + + from contrib.ydb.public.api import protos + + sys.modules["ydb._grpc.common.protos"] = sys.modules["contrib.ydb.public.api.protos"] +elif _utilities.check_module_exists("ydb.public.api"): from ydb.public.api.grpc import * # noqa sys.modules["ydb._grpc.common"] = sys.modules["ydb.public.api.grpc"] diff --git a/ydb/draft/_apis.py b/ydb/draft/_apis.py index 5b878677..e3f63387 100644 --- a/ydb/draft/_apis.py +++ b/ydb/draft/_apis.py @@ -15,9 +15,14 @@ ydb_dynamic_config_v1_pb2_grpc, ) - from .._grpc.common.draft.protos import ( - ydb_dynamic_config_pb2, - ) + try: + from .._grpc.common.draft.protos import ( + ydb_dynamic_config_pb2, + ) + except ImportError: + from .._grpc.common.protos.draft import ( + ydb_dynamic_config_pb2, + ) ydb_dynamic_config = ydb_dynamic_config_pb2