gremlinpython 3.7.1__tar.gz → 3.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gremlinpython-3.7.2/NOTICE +5 -0
- {gremlinpython-3.7.1/gremlinpython.egg-info → gremlinpython-3.7.2}/PKG-INFO +1 -1
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/__version__.py +2 -2
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/aiohttp/transport.py +3 -1
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/connection.py +4 -3
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/protocol.py +24 -22
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/serializer.py +1 -1
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/useragent.py +1 -1
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/process/graph_traversal.py +41 -5
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/process/traversal.py +2 -2
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/structure/io/graphsonV2d0.py +25 -1
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/structure/io/graphsonV3d0.py +26 -1
- {gremlinpython-3.7.1 → gremlinpython-3.7.2/gremlinpython.egg-info}/PKG-INFO +1 -1
- gremlinpython-3.7.1/NOTICE +0 -5
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/LICENSE +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/MANIFEST.in +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/README.rst +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/__init__.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/__init__.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/aiohttp/__init__.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/client.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/driver_remote_connection.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/remote_connection.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/request.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/resultset.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/transport.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/process/__init__.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/process/anonymous_traversal.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/process/strategies.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/process/translator.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/statics.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/structure/__init__.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/structure/graph.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/structure/io/__init__.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/structure/io/graphbinaryV1.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/structure/io/util.py +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlinpython.egg-info/SOURCES.txt +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlinpython.egg-info/dependency_links.txt +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlinpython.egg-info/requires.txt +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlinpython.egg-info/top_level.txt +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/setup.cfg +0 -0
- {gremlinpython-3.7.1 → gremlinpython-3.7.2}/setup.py +0 -0
|
@@ -211,7 +211,9 @@ class AiohttpHTTPTransport(AbstractBaseTransport):
|
|
|
211
211
|
# Inner function to perform async read.
|
|
212
212
|
async def async_read():
|
|
213
213
|
async with async_timeout.timeout(self._read_timeout):
|
|
214
|
-
return await self._http_req_resp.read()
|
|
214
|
+
return {"content": await self._http_req_resp.read(),
|
|
215
|
+
"ok": self._http_req_resp.ok,
|
|
216
|
+
"status": self._http_req_resp.status}
|
|
215
217
|
|
|
216
218
|
return self._loop.run_until_complete(async_read())
|
|
217
219
|
|
|
@@ -58,10 +58,11 @@ class Connection:
|
|
|
58
58
|
def write(self, request_message):
|
|
59
59
|
if not self._inited:
|
|
60
60
|
self.connect()
|
|
61
|
-
request_id = str(uuid.uuid4())
|
|
62
61
|
if request_message.args.get("requestId"):
|
|
63
|
-
request_id = request_message.args.get("requestId")
|
|
64
|
-
uuid.UUID(request_id)
|
|
62
|
+
request_id = str(request_message.args.get("requestId"))
|
|
63
|
+
uuid.UUID(request_id) # Checks for proper UUID or else server will return an error.
|
|
64
|
+
else:
|
|
65
|
+
request_id = str(uuid.uuid4())
|
|
65
66
|
result_set = resultset.ResultSet(queue.Queue(), request_id)
|
|
66
67
|
self._results[request_id] = result_set
|
|
67
68
|
# Create write task
|
|
@@ -223,35 +223,37 @@ class GremlinServerHTTPProtocol(AbstractBaseProtocol):
|
|
|
223
223
|
|
|
224
224
|
self._transport.write(message)
|
|
225
225
|
|
|
226
|
-
def data_received(self,
|
|
226
|
+
def data_received(self, response, results_dict):
|
|
227
227
|
# if Gremlin Server cuts off then we get a None for the message
|
|
228
|
-
if
|
|
228
|
+
if response is None:
|
|
229
229
|
log.error("Received empty message from server.")
|
|
230
230
|
raise GremlinServerError({'code': 500,
|
|
231
231
|
'message': 'Server disconnected - please try to reconnect', 'attributes': {}})
|
|
232
232
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
return status_code
|
|
245
|
-
elif status_code in [200, 206]:
|
|
246
|
-
result_set.stream.put_nowait(data)
|
|
247
|
-
if status_code == 200:
|
|
248
|
-
result_set.status_attributes = message['status']['attributes']
|
|
233
|
+
if response['ok']:
|
|
234
|
+
message = self._message_serializer.deserialize_message(response['content'])
|
|
235
|
+
request_id = message['requestId']
|
|
236
|
+
result_set = results_dict[request_id] if request_id in results_dict else ResultSet(None, None)
|
|
237
|
+
status_code = message['status']['code']
|
|
238
|
+
aggregate_to = message['result']['meta'].get('aggregateTo', 'list')
|
|
239
|
+
data = message['result']['data']
|
|
240
|
+
result_set.aggregate_to = aggregate_to
|
|
241
|
+
|
|
242
|
+
if status_code == 204:
|
|
243
|
+
result_set.stream.put_nowait([])
|
|
249
244
|
del results_dict[request_id]
|
|
250
|
-
|
|
245
|
+
return status_code
|
|
246
|
+
elif status_code in [200, 206]:
|
|
247
|
+
result_set.stream.put_nowait(data)
|
|
248
|
+
if status_code == 200:
|
|
249
|
+
result_set.status_attributes = message['status']['attributes']
|
|
250
|
+
del results_dict[request_id]
|
|
251
|
+
return status_code
|
|
251
252
|
else:
|
|
252
253
|
# This message is going to be huge and kind of hard to read, but in the event of an error,
|
|
253
254
|
# it can provide invaluable info, so space it out appropriately.
|
|
254
255
|
log.error("\r\nReceived error message '%s'\r\n\r\nWith results dictionary '%s'",
|
|
255
|
-
str(
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
str(response['content']), str(results_dict))
|
|
257
|
+
body = json.loads(response['content'])
|
|
258
|
+
del results_dict[body['requestId']]
|
|
259
|
+
raise GremlinServerError({'code': response['status'], 'message': body['message'], 'attributes': {}})
|
|
@@ -240,7 +240,7 @@ class GraphBinarySerializersV1(object):
|
|
|
240
240
|
def finalize_message(self, message, mime_len, mime_type):
|
|
241
241
|
ba = bytearray()
|
|
242
242
|
|
|
243
|
-
request_id = uuid.UUID(message['requestId'])
|
|
243
|
+
request_id = uuid.UUID(str(message['requestId']))
|
|
244
244
|
ba.extend(self.header_pack(mime_len, mime_type, 0x81,
|
|
245
245
|
(request_id.int >> 64) & self.max_int64, request_id.int & self.max_int64))
|
|
246
246
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
#
|
|
19
19
|
import platform
|
|
20
20
|
|
|
21
|
-
gremlin_version = "3.7.
|
|
21
|
+
gremlin_version = "3.7.2" # DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
|
|
22
22
|
|
|
23
23
|
def _generate_user_agent():
|
|
24
24
|
application_name = "NotAvailable"
|
|
@@ -659,6 +659,10 @@ class GraphTraversal(Traversal):
|
|
|
659
659
|
self.bytecode.add_step("lTrim", *args)
|
|
660
660
|
return self
|
|
661
661
|
|
|
662
|
+
def l_trim(self, *args):
|
|
663
|
+
self.bytecode.add_step("lTrim", *args)
|
|
664
|
+
return self
|
|
665
|
+
|
|
662
666
|
def map(self, *args):
|
|
663
667
|
self.bytecode.add_step("map", *args)
|
|
664
668
|
return self
|
|
@@ -841,6 +845,10 @@ class GraphTraversal(Traversal):
|
|
|
841
845
|
self.bytecode.add_step("rTrim", *args)
|
|
842
846
|
return self
|
|
843
847
|
|
|
848
|
+
def r_trim(self, *args):
|
|
849
|
+
self.bytecode.add_step("rTrim", *args)
|
|
850
|
+
return self
|
|
851
|
+
|
|
844
852
|
def sack(self, *args):
|
|
845
853
|
self.bytecode.add_step("sack", *args)
|
|
846
854
|
return self
|
|
@@ -1413,7 +1421,15 @@ class __(object, metaclass=MagicType):
|
|
|
1413
1421
|
|
|
1414
1422
|
@classmethod
|
|
1415
1423
|
def ltrim(cls, *args):
|
|
1416
|
-
|
|
1424
|
+
warnings.warn(
|
|
1425
|
+
"gremlin_python.process.__.ltrim will be replaced by "
|
|
1426
|
+
"gremlin_python.process.__.l_trim.",
|
|
1427
|
+
DeprecationWarning)
|
|
1428
|
+
return cls.l_trim(*args)
|
|
1429
|
+
|
|
1430
|
+
@classmethod
|
|
1431
|
+
def l_trim(cls, *args):
|
|
1432
|
+
return cls.graph_traversal(None, None, Bytecode()).l_trim(*args)
|
|
1417
1433
|
|
|
1418
1434
|
@classmethod
|
|
1419
1435
|
def map(cls, *args):
|
|
@@ -1557,7 +1573,15 @@ class __(object, metaclass=MagicType):
|
|
|
1557
1573
|
|
|
1558
1574
|
@classmethod
|
|
1559
1575
|
def rTrim(cls, *args):
|
|
1560
|
-
|
|
1576
|
+
warnings.warn(
|
|
1577
|
+
"gremlin_python.process.__.rTrim will be replaced by "
|
|
1578
|
+
"gremlin_python.process.__.r_trim.",
|
|
1579
|
+
DeprecationWarning)
|
|
1580
|
+
return cls.r_trim(*args)
|
|
1581
|
+
|
|
1582
|
+
@classmethod
|
|
1583
|
+
def r_trim(cls, *args):
|
|
1584
|
+
return cls.graph_traversal(None, None, Bytecode()).r_trim(*args)
|
|
1561
1585
|
|
|
1562
1586
|
@classmethod
|
|
1563
1587
|
def sack(cls, *args):
|
|
@@ -1751,7 +1775,7 @@ class Transaction:
|
|
|
1751
1775
|
def rollback(self):
|
|
1752
1776
|
with self.__mutex:
|
|
1753
1777
|
# Verify transaction is open, close session and return result of transaction's rollback.
|
|
1754
|
-
self.__verify_transaction_state(True, "Cannot
|
|
1778
|
+
self.__verify_transaction_state(True, "Cannot rollback a transaction that is not started.")
|
|
1755
1779
|
return self.__close_session(self._session_based_connection.rollback())
|
|
1756
1780
|
|
|
1757
1781
|
# Commits the current transaction.
|
|
@@ -2084,7 +2108,11 @@ def loops(*args):
|
|
|
2084
2108
|
|
|
2085
2109
|
|
|
2086
2110
|
def ltrim(*args):
|
|
2087
|
-
return __.
|
|
2111
|
+
return __.l_trim(*args)
|
|
2112
|
+
|
|
2113
|
+
|
|
2114
|
+
def l_trim(*args):
|
|
2115
|
+
return __.l_trim(*args)
|
|
2088
2116
|
|
|
2089
2117
|
|
|
2090
2118
|
def map(*args):
|
|
@@ -2204,7 +2232,11 @@ def reverse(*args):
|
|
|
2204
2232
|
|
|
2205
2233
|
|
|
2206
2234
|
def rTrim(*args):
|
|
2207
|
-
return __.
|
|
2235
|
+
return __.r_trim(*args)
|
|
2236
|
+
|
|
2237
|
+
|
|
2238
|
+
def r_trim(*args):
|
|
2239
|
+
return __.r_trim(*args)
|
|
2208
2240
|
|
|
2209
2241
|
|
|
2210
2242
|
def sack(*args):
|
|
@@ -2485,6 +2517,8 @@ statics.add_static('loops', loops)
|
|
|
2485
2517
|
|
|
2486
2518
|
statics.add_static('ltrim', ltrim)
|
|
2487
2519
|
|
|
2520
|
+
statics.add_static('l_trim', l_trim)
|
|
2521
|
+
|
|
2488
2522
|
statics.add_static('map', map)
|
|
2489
2523
|
|
|
2490
2524
|
statics.add_static('match', match)
|
|
@@ -2545,6 +2579,8 @@ statics.add_static('reverse', reverse)
|
|
|
2545
2579
|
|
|
2546
2580
|
statics.add_static('rTrim', rTrim)
|
|
2547
2581
|
|
|
2582
|
+
statics.add_static('r_trim', r_trim)
|
|
2583
|
+
|
|
2548
2584
|
statics.add_static('sack', sack)
|
|
2549
2585
|
|
|
2550
2586
|
statics.add_static('sample', sample)
|
|
@@ -214,9 +214,9 @@ statics.add_static('shuffle', Order.shuffle)
|
|
|
214
214
|
statics.add_static('asc', Order.asc)
|
|
215
215
|
statics.add_static('desc', Order.desc)
|
|
216
216
|
|
|
217
|
-
Pick = Enum('Pick', '
|
|
217
|
+
Pick = Enum('Pick', ' any_ none')
|
|
218
218
|
|
|
219
|
-
statics.add_static('
|
|
219
|
+
statics.add_static('any_', Pick.any_)
|
|
220
220
|
statics.add_static('none', Pick.none)
|
|
221
221
|
|
|
222
222
|
Pop = Enum('Pop', ' all_ first last mixed')
|
|
@@ -30,7 +30,7 @@ from aenum import Enum
|
|
|
30
30
|
from isodate import parse_duration, duration_isoformat
|
|
31
31
|
|
|
32
32
|
from gremlin_python import statics
|
|
33
|
-
from gremlin_python.statics import FloatType, FunctionType, IntType, LongType, TypeType, SingleByte, ByteBufferType, SingleChar
|
|
33
|
+
from gremlin_python.statics import FloatType, FunctionType, ShortType, IntType, LongType, TypeType, SingleByte, ByteBufferType, SingleChar
|
|
34
34
|
from gremlin_python.process.traversal import Binding, Bytecode, P, TextP, Traversal, Traverser, TraversalStrategy
|
|
35
35
|
from gremlin_python.structure.graph import Edge, Property, Vertex, VertexProperty, Path
|
|
36
36
|
from gremlin_python.structure.io.util import SymbolUtil
|
|
@@ -498,6 +498,30 @@ class Int32IO(Int64IO):
|
|
|
498
498
|
return GraphSONUtil.typed_value(cls.graphson_base_type, n)
|
|
499
499
|
|
|
500
500
|
|
|
501
|
+
class Int16IO(Int64IO):
|
|
502
|
+
python_type = ShortType
|
|
503
|
+
graphson_type = "gx:Int16"
|
|
504
|
+
graphson_base_type = "Int16"
|
|
505
|
+
|
|
506
|
+
@classmethod
|
|
507
|
+
def dictify(cls, n, writer):
|
|
508
|
+
# if we exceed Java int range then we need a long
|
|
509
|
+
if isinstance(n, bool):
|
|
510
|
+
return n
|
|
511
|
+
elif n < -9223372036854775808 or n > 9223372036854775807:
|
|
512
|
+
return GraphSONUtil.typed_value("BigInteger", str(n), "gx")
|
|
513
|
+
elif n < -2147483648 or n > 2147483647:
|
|
514
|
+
return GraphSONUtil.typed_value("Int64", n)
|
|
515
|
+
elif n < -32768 or n > 32767:
|
|
516
|
+
return GraphSONUtil.typed_value("Int32", n)
|
|
517
|
+
else:
|
|
518
|
+
return GraphSONUtil.typed_value(cls.graphson_base_type, n, "gx")
|
|
519
|
+
|
|
520
|
+
@classmethod
|
|
521
|
+
def objectify(cls, v, _):
|
|
522
|
+
return int.__new__(ShortType, v)
|
|
523
|
+
|
|
524
|
+
|
|
501
525
|
class ByteIO(_NumberIO):
|
|
502
526
|
python_type = SingleByte
|
|
503
527
|
graphson_type = "gx:Byte"
|
|
@@ -29,7 +29,7 @@ from aenum import Enum
|
|
|
29
29
|
from isodate import parse_duration, duration_isoformat
|
|
30
30
|
|
|
31
31
|
from gremlin_python import statics
|
|
32
|
-
from gremlin_python.statics import FloatType, FunctionType, IntType, LongType, TypeType, DictType, ListType, SetType, SingleByte, ByteBufferType, SingleChar
|
|
32
|
+
from gremlin_python.statics import FloatType, FunctionType, ShortType, IntType, LongType, TypeType, DictType, ListType, SetType, SingleByte, ByteBufferType, SingleChar
|
|
33
33
|
from gremlin_python.process.traversal import Binding, Bytecode, Direction, P, TextP, Traversal, Traverser, TraversalStrategy, T
|
|
34
34
|
from gremlin_python.structure.graph import Edge, Property, Vertex, VertexProperty, Path
|
|
35
35
|
from gremlin_python.structure.io.util import HashableDict, SymbolUtil
|
|
@@ -597,6 +597,31 @@ class Int32IO(Int64IO):
|
|
|
597
597
|
else:
|
|
598
598
|
return GraphSONUtil.typed_value(cls.graphson_base_type, n)
|
|
599
599
|
|
|
600
|
+
|
|
601
|
+
class Int16IO(Int64IO):
|
|
602
|
+
python_type = ShortType
|
|
603
|
+
graphson_type = "gx:Int16"
|
|
604
|
+
graphson_base_type = "Int16"
|
|
605
|
+
|
|
606
|
+
@classmethod
|
|
607
|
+
def dictify(cls, n, writer):
|
|
608
|
+
# if we exceed Java int range then we need a long
|
|
609
|
+
if isinstance(n, bool):
|
|
610
|
+
return n
|
|
611
|
+
elif n < -9223372036854775808 or n > 9223372036854775807:
|
|
612
|
+
return GraphSONUtil.typed_value("BigInteger", str(n), "gx")
|
|
613
|
+
elif n < -2147483648 or n > 2147483647:
|
|
614
|
+
return GraphSONUtil.typed_value("Int64", n)
|
|
615
|
+
elif n < -32768 or n > 32767:
|
|
616
|
+
return GraphSONUtil.typed_value("Int32", n)
|
|
617
|
+
else:
|
|
618
|
+
return GraphSONUtil.typed_value(cls.graphson_base_type, n, "gx")
|
|
619
|
+
|
|
620
|
+
@classmethod
|
|
621
|
+
def objectify(cls, v, _):
|
|
622
|
+
return int.__new__(ShortType, v)
|
|
623
|
+
|
|
624
|
+
|
|
600
625
|
class ByteIO(_NumberIO):
|
|
601
626
|
python_type = SingleByte
|
|
602
627
|
graphson_type = "gx:Byte"
|
gremlinpython-3.7.1/NOTICE
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gremlinpython-3.7.1 → gremlinpython-3.7.2}/gremlin_python/driver/driver_remote_connection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|