Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
[[release-4-0-0]]
=== TinkerPop 4.0.0 (Release Date: NOT OFFICIALLY RELEASED YET)

* Fixed `gremlin-python` `GremlinLang` equality (`__eq__`) which compared a traversal to itself, so traversals with different steps but equal parameters were incorrectly considered equal.
* Removed the deprecated `gremlin-python` `DriverRemoteConnection.submitAsync` method in favor of `submit_async`.
* Added GraphBinary `Tree` (`0x2b`) serialization and deserialization with a native tree-shaped API to `gremlin-python`, `gremlin-dotnet`, `gremlin-go`, and `gremlin-javascript`.
* Added a `gremlin/io` package export in `gremlin-javascript` exposing the GraphBinary type serializers.
* Raised the minimum Java version to 17 for building and running *(breaking)*.
Expand Down
14 changes: 14 additions & 0 deletions docs/src/upgrade/release-4.x.x.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,20 @@ Custom transport implementations are no longer supported. The driver uses `Aioht

See: link:https://tinkerpop.apache.org/docs/4.0.0/reference/#gremlin-python[Gremlin-Python]

==== Removal of Python DriverRemoteConnection.submitAsync

The deprecated `DriverRemoteConnection.submitAsync()` method has been removed. After the TinkerPop 4 change to accept
a single `GremlinLang` argument, it no longer functioned. Use `submit_async()` instead:

[source,python]
----
# Before
future = connection.submitAsync(gremlin_lang)

# After
future = connection.submit_async(gremlin_lang)
----

==== Removal of sparql-gremlin

The `sparql-gremlin` module has been removed following a prolonged period of inactivity. There is currently no direct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#
import logging
from concurrent.futures import Future
import warnings

from gremlin_python.driver import client, serializer
from gremlin_python.driver.remote_connection import RemoteConnection, RemoteTraversal
Expand Down Expand Up @@ -75,13 +74,6 @@ def submit(self, gremlin_lang):
request_options=self.extract_request_options(gremlin_lang))
return RemoteTraversal(result_set)

def submitAsync(self, message, parameters=None, request_options=None):
warnings.warn(
"gremlin_python.driver.driver_remote_connection.DriverRemoteConnection.submitAsync will be replaced by "
"gremlin_python.driver.driver_remote_connection.DriverRemoteConnection.submit_async.",
DeprecationWarning)
self.submit_async(message, parameters, request_options)

def submit_async(self, gremlin_lang):
log.debug("submit_async with gremlin lang script '%s'", gremlin_lang.get_gremlin())
future = Future()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ def add_step(self, step_name, *args):

def __eq__(self, other):
if isinstance(other, self.__class__):
return ''.join(self.gremlin) == ''.join(self.gremlin) and self.parameters == other.parameters
return ''.join(self.gremlin) == ''.join(other.gremlin) and self.parameters == other.parameters
else:
return False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,3 +708,33 @@ def test_match_gql_query_bytecode(self):
assert ("g.match('" + query + "')") == g.match(query).gremlin_lang.get_gremlin()
params = {'name': 'marko'}
assert ("g.match('" + query + "',['name':'marko'])") == g.match(query, params).gremlin_lang.get_gremlin()

def test_eq_different_gremlin_steps_not_equal(self):
# Same (empty) parameters but different gremlin steps must not compare equal.
g = traversal().with_(None)
count = g.V().count().gremlin_lang
drop = g.V().drop().gremlin_lang
assert count.parameters == drop.parameters
assert count.get_gremlin() != drop.get_gremlin()
assert count != drop
assert drop != count

def test_eq_equivalent_are_equal(self):
g = traversal().with_(None)
first = g.V().count().gremlin_lang
second = g.V().count().gremlin_lang
assert first == second

def test_eq_equal_gremlin_different_parameters_not_equal(self):
g = traversal().with_(None)
first = g.V(GValue('ids', 1)).gremlin_lang
second = g.V(GValue('ids', 2)).gremlin_lang
assert first.get_gremlin() == second.get_gremlin()
assert first != second

def test_eq_non_gremlinlang_not_equal(self):
g = traversal().with_(None)
gl = g.V().count().gremlin_lang
assert gl != 'g.V().count()'
assert gl != 42
assert gl != None
Loading