Skip to content

Commit 68411b6

Browse files
authored
regenerate protos with python3.11 (#238)
1 parent 7248ddb commit 68411b6

File tree

2 files changed

+162
-85
lines changed

2 files changed

+162
-85
lines changed

pydgraph/proto/api_pb2.py

Lines changed: 66 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pydgraph/proto/api_pb2_grpc.py

Lines changed: 96 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
4+
import warnings
45

56
import api_pb2 as api__pb2
67

8+
GRPC_GENERATED_VERSION = '1.65.1'
9+
GRPC_VERSION = grpc.__version__
10+
EXPECTED_ERROR_RELEASE = '1.66.0'
11+
SCHEDULED_RELEASE_DATE = 'August 6, 2024'
12+
_version_not_supported = False
13+
14+
try:
15+
from grpc._utilities import first_version_is_lower
16+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
17+
except ImportError:
18+
_version_not_supported = True
19+
20+
if _version_not_supported:
21+
warnings.warn(
22+
f'The grpc package installed is at version {GRPC_VERSION},'
23+
+ f' but the generated code in api_pb2_grpc.py depends on'
24+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
25+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
26+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
27+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
28+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
29+
RuntimeWarning
30+
)
31+
732

833
class DgraphStub(object):
934
"""Graph response.
@@ -19,27 +44,27 @@ def __init__(self, channel):
1944
'/api.Dgraph/Login',
2045
request_serializer=api__pb2.LoginRequest.SerializeToString,
2146
response_deserializer=api__pb2.Response.FromString,
22-
)
47+
_registered_method=True)
2348
self.Query = channel.unary_unary(
2449
'/api.Dgraph/Query',
2550
request_serializer=api__pb2.Request.SerializeToString,
2651
response_deserializer=api__pb2.Response.FromString,
27-
)
52+
_registered_method=True)
2853
self.Alter = channel.unary_unary(
2954
'/api.Dgraph/Alter',
3055
request_serializer=api__pb2.Operation.SerializeToString,
3156
response_deserializer=api__pb2.Payload.FromString,
32-
)
57+
_registered_method=True)
3358
self.CommitOrAbort = channel.unary_unary(
3459
'/api.Dgraph/CommitOrAbort',
3560
request_serializer=api__pb2.TxnContext.SerializeToString,
3661
response_deserializer=api__pb2.TxnContext.FromString,
37-
)
62+
_registered_method=True)
3863
self.CheckVersion = channel.unary_unary(
3964
'/api.Dgraph/CheckVersion',
4065
request_serializer=api__pb2.Check.SerializeToString,
4166
response_deserializer=api__pb2.Version.FromString,
42-
)
67+
_registered_method=True)
4368

4469

4570
class DgraphServicer(object):
@@ -108,6 +133,7 @@ def add_DgraphServicer_to_server(servicer, server):
108133
generic_handler = grpc.method_handlers_generic_handler(
109134
'api.Dgraph', rpc_method_handlers)
110135
server.add_generic_rpc_handlers((generic_handler,))
136+
server.add_registered_method_handlers('api.Dgraph', rpc_method_handlers)
111137

112138

113139
# This class is part of an EXPERIMENTAL API.
@@ -126,11 +152,21 @@ def Login(request,
126152
wait_for_ready=None,
127153
timeout=None,
128154
metadata=None):
129-
return grpc.experimental.unary_unary(request, target, '/api.Dgraph/Login',
155+
return grpc.experimental.unary_unary(
156+
request,
157+
target,
158+
'/api.Dgraph/Login',
130159
api__pb2.LoginRequest.SerializeToString,
131160
api__pb2.Response.FromString,
132-
options, channel_credentials,
133-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
161+
options,
162+
channel_credentials,
163+
insecure,
164+
call_credentials,
165+
compression,
166+
wait_for_ready,
167+
timeout,
168+
metadata,
169+
_registered_method=True)
134170

135171
@staticmethod
136172
def Query(request,
@@ -143,11 +179,21 @@ def Query(request,
143179
wait_for_ready=None,
144180
timeout=None,
145181
metadata=None):
146-
return grpc.experimental.unary_unary(request, target, '/api.Dgraph/Query',
182+
return grpc.experimental.unary_unary(
183+
request,
184+
target,
185+
'/api.Dgraph/Query',
147186
api__pb2.Request.SerializeToString,
148187
api__pb2.Response.FromString,
149-
options, channel_credentials,
150-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
188+
options,
189+
channel_credentials,
190+
insecure,
191+
call_credentials,
192+
compression,
193+
wait_for_ready,
194+
timeout,
195+
metadata,
196+
_registered_method=True)
151197

152198
@staticmethod
153199
def Alter(request,
@@ -160,11 +206,21 @@ def Alter(request,
160206
wait_for_ready=None,
161207
timeout=None,
162208
metadata=None):
163-
return grpc.experimental.unary_unary(request, target, '/api.Dgraph/Alter',
209+
return grpc.experimental.unary_unary(
210+
request,
211+
target,
212+
'/api.Dgraph/Alter',
164213
api__pb2.Operation.SerializeToString,
165214
api__pb2.Payload.FromString,
166-
options, channel_credentials,
167-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
215+
options,
216+
channel_credentials,
217+
insecure,
218+
call_credentials,
219+
compression,
220+
wait_for_ready,
221+
timeout,
222+
metadata,
223+
_registered_method=True)
168224

169225
@staticmethod
170226
def CommitOrAbort(request,
@@ -177,11 +233,21 @@ def CommitOrAbort(request,
177233
wait_for_ready=None,
178234
timeout=None,
179235
metadata=None):
180-
return grpc.experimental.unary_unary(request, target, '/api.Dgraph/CommitOrAbort',
236+
return grpc.experimental.unary_unary(
237+
request,
238+
target,
239+
'/api.Dgraph/CommitOrAbort',
181240
api__pb2.TxnContext.SerializeToString,
182241
api__pb2.TxnContext.FromString,
183-
options, channel_credentials,
184-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
242+
options,
243+
channel_credentials,
244+
insecure,
245+
call_credentials,
246+
compression,
247+
wait_for_ready,
248+
timeout,
249+
metadata,
250+
_registered_method=True)
185251

186252
@staticmethod
187253
def CheckVersion(request,
@@ -194,8 +260,18 @@ def CheckVersion(request,
194260
wait_for_ready=None,
195261
timeout=None,
196262
metadata=None):
197-
return grpc.experimental.unary_unary(request, target, '/api.Dgraph/CheckVersion',
263+
return grpc.experimental.unary_unary(
264+
request,
265+
target,
266+
'/api.Dgraph/CheckVersion',
198267
api__pb2.Check.SerializeToString,
199268
api__pb2.Version.FromString,
200-
options, channel_credentials,
201-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
269+
options,
270+
channel_credentials,
271+
insecure,
272+
call_credentials,
273+
compression,
274+
wait_for_ready,
275+
timeout,
276+
metadata,
277+
_registered_method=True)

0 commit comments

Comments
 (0)