diff --git a/CHANGELOG.md b/CHANGELOG.md index de992bf4..2c85f95b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.11.0 ## + +* removed unused experimental client from ydb python sdk. + ## 2.10.0 ## * fixed double quoting issue in sqlalchemy diff --git a/setup.py b/setup.py index 761ce164..64cb0abf 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name="ydb", - version="2.10.0", + version="2.11.0", description="YDB Python SDK", author="Yandex LLC", author_email="ydb@yandex-team.ru", diff --git a/ydb/__init__.py b/ydb/__init__.py index 7dd45200..5cbe4f1a 100644 --- a/ydb/__init__.py +++ b/ydb/__init__.py @@ -1,4 +1,3 @@ -from .experimental import * # noqa from .credentials import * # noqa from .driver import * # noqa from .table import * # noqa diff --git a/ydb/experimental.py b/ydb/experimental.py deleted file mode 100644 index 92f9972b..00000000 --- a/ydb/experimental.py +++ /dev/null @@ -1,61 +0,0 @@ -from ydb.public.api.protos import ydb_experimental_pb2 -from ydb.public.api.grpc.draft import ydb_experimental_v1_pb2_grpc -from . import _utilities, issues, convert - - -def _execute_stream_query_request_factory(yql_text, parameters=None, settings=None): - request = ydb_experimental_pb2.ExecuteStreamQueryRequest() - request.yql_text = yql_text - request.profile_mode = 1 - return request - - -class StreamQueryResult(object): - def __init__(self, result): - self._result = result - - def is_progress(self): - return self._result.WhichOneof("result") == "ping" - - @property - def result_set(self): - return convert.ResultSet.from_message(self._result.result_set) - - def is_result_set(self): - return self._result.WhichOneof("result") == "result_set" - - -def _wrap_stream_query_response(response): - issues._process_response(response) - return StreamQueryResult(response.result) - - -class ExperimentalClient(object): - def __init__(self, driver): - self.driver = driver - - def async_execute_stream_query(self, yql_text, parameters=None, settings=None): - """ - That is experimental api. Can be used only for tests, not for production. - """ - request = _execute_stream_query_request_factory(yql_text, parameters, settings) - stream_it = self.driver( - request, - ydb_experimental_v1_pb2_grpc.ExperimentalServiceStub, - "ExecuteStreamQuery", - settings=settings, - ) - return _utilities.AsyncResponseIterator(stream_it, _wrap_stream_query_response) - - def execute_stream_query(self, yql_text, parameters=None, settings=None): - """ - That is experimental api. Can be used only for tests, not for production. - """ - request = _execute_stream_query_request_factory(yql_text, parameters, settings) - stream_it = self.driver( - request, - ydb_experimental_v1_pb2_grpc.ExperimentalServiceStub, - "ExecuteStreamQuery", - settings=settings, - ) - return _utilities.SyncResponseIterator(stream_it, _wrap_stream_query_response) diff --git a/ydb/public/api/grpc/draft/ydb_experimental_v1_pb2.py b/ydb/public/api/grpc/draft/ydb_experimental_v1_pb2.py deleted file mode 100644 index 456dd1ae..00000000 --- a/ydb/public/api/grpc/draft/ydb_experimental_v1_pb2.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ydb/public/api/grpc/draft/ydb_experimental_v1.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ydb.public.api.protos import ydb_experimental_pb2 as ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='ydb/public/api/grpc/draft/ydb_experimental_v1.proto', - package='Ydb.Experimental.V1', - syntax='proto3', - serialized_options=b'\n\036com.yandex.ydb.experimental.v1', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n3ydb/public/api/grpc/draft/ydb_experimental_v1.proto\x12\x13Ydb.Experimental.V1\x1a,ydb/public/api/protos/ydb_experimental.proto2\x88\x01\n\x13\x45xperimentalService\x12q\n\x12\x45xecuteStreamQuery\x12+.Ydb.Experimental.ExecuteStreamQueryRequest\x1a,.Ydb.Experimental.ExecuteStreamQueryResponse0\x01\x42 \n\x1e\x63om.yandex.ydb.experimental.v1b\x06proto3' - , - dependencies=[ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2.DESCRIPTOR,]) - - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -DESCRIPTOR._options = None - -_EXPERIMENTALSERVICE = _descriptor.ServiceDescriptor( - name='ExperimentalService', - full_name='Ydb.Experimental.V1.ExperimentalService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=123, - serialized_end=259, - methods=[ - _descriptor.MethodDescriptor( - name='ExecuteStreamQuery', - full_name='Ydb.Experimental.V1.ExperimentalService.ExecuteStreamQuery', - index=0, - containing_service=None, - input_type=ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2._EXECUTESTREAMQUERYREQUEST, - output_type=ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2._EXECUTESTREAMQUERYRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_EXPERIMENTALSERVICE) - -DESCRIPTOR.services_by_name['ExperimentalService'] = _EXPERIMENTALSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/ydb/public/api/grpc/draft/ydb_experimental_v1_pb2_grpc.py b/ydb/public/api/grpc/draft/ydb_experimental_v1_pb2_grpc.py deleted file mode 100644 index d03cb2ef..00000000 --- a/ydb/public/api/grpc/draft/ydb_experimental_v1_pb2_grpc.py +++ /dev/null @@ -1,66 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from ydb.public.api.protos import ydb_experimental_pb2 as ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2 - - -class ExperimentalServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ExecuteStreamQuery = channel.unary_stream( - '/Ydb.Experimental.V1.ExperimentalService/ExecuteStreamQuery', - request_serializer=ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2.ExecuteStreamQueryRequest.SerializeToString, - response_deserializer=ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2.ExecuteStreamQueryResponse.FromString, - ) - - -class ExperimentalServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def ExecuteStreamQuery(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ExperimentalServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'ExecuteStreamQuery': grpc.unary_stream_rpc_method_handler( - servicer.ExecuteStreamQuery, - request_deserializer=ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2.ExecuteStreamQueryRequest.FromString, - response_serializer=ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2.ExecuteStreamQueryResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'Ydb.Experimental.V1.ExperimentalService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class ExperimentalService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def ExecuteStreamQuery(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/Ydb.Experimental.V1.ExperimentalService/ExecuteStreamQuery', - ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2.ExecuteStreamQueryRequest.SerializeToString, - ydb_dot_public_dot_api_dot_protos_dot_ydb__experimental__pb2.ExecuteStreamQueryResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata)