diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 818e8819a6e..f3a93b0c2ab 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -163,7 +163,7 @@ jobs: run: | touch gremlin-python/.glv mvn clean install -pl -:gremlin-javascript,-gremlin-dotnet,-:gremlin-dotnet-source,-:gremlin-dotnet-tests,-:gremlint -q -DskipTests -Dci - mvn verify -pl gremlin-python + mvn verify -pl gremlin-python -DincludeNeo4j dotnet: name: .NET timeout-minutes: 1200 # 20 minutes diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 3dca81956a8..fa945de09df 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -23,6 +23,9 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima [[release-3-5-2]] === TinkerPop 3.5.2 (Release Date: NOT OFFICIALLY RELEASED YET) +* Added support for `g.Tx()` in Python. +* Added logging in in Python. +* Fixed shutdown cleanup issue in Python aiohttp transport layer. * Added a `NoSugarTranslator` translator to `PythonTranslator` which translates Gremlin queries to Python without syntactic sugar (ex `g.V().limit(1)` instead of `g.V()[0:1]`) * Added support for `g.Tx()` in .NET. * Added support for `with()` constant options to `io()`. diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index d107d078b18..b994237d60b 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -913,6 +913,37 @@ Apache TinkerPop's JVM-based Gremlin traversal machine. As such, their `apply(Tr the strategy is encoded in the Gremlin-Python bytecode and transmitted to the Gremlin traversal machine for re-construction machine-side. +[[gremlin-python-transactions]] +=== Transactions + +To get a full understanding of this section, it would be good to start by reading the <> +section of this documentation, which discusses transactions in the general context of TinkerPop itself. This section +builds on that content by demonstrating the transactional syntax for Javascript. + +[source,python] +---- +g = traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin')) + +# Create a Transaction. +tx = g.tx() + +# Spawn a new GraphTraversalSource, binding all traversals established from it to tx. +gtx = tx.begin() + +try: + # Execute a traversal within the transaction. + gtx.addV("person").property("name", "Lyndon").iterate(), + + # Commit the transaction. The transaction can no longer be used and cannot be re-used. + # A new transaction can be spawned through g.tx(). + # The context of g remains sessionless throughout the process. + gtx.commit() +except Exception e: + # Rollback the transaction if an error occurs. + gtx.rollback() + +---- + [[gremlin-python-lambda]] === The Lambda Solution diff --git a/docs/src/upgrade/release-3.5.x.asciidoc b/docs/src/upgrade/release-3.5.x.asciidoc index 882c8c19826..6a4dd73c6e7 100644 --- a/docs/src/upgrade/release-3.5.x.asciidoc +++ b/docs/src/upgrade/release-3.5.x.asciidoc @@ -30,13 +30,20 @@ complete list of all the modifications that are part of this release. === Upgrading for Users -==== tx() in .NET +==== Tx() in .NET and tx() in Python -After Javascript, .NET is now the second non-JVM variant of Gremlin to get support for -link:https://tinkerpop.apache.org/docs/3.5.2/reference/#transactions[remote transactions]. An example of the `Tx()` -syntax can be found in the .NET link:https://tinkerpop.apache.org/docs/3.5.2/reference/#gremlin-dotnet-transactions[Transaction Section]. +After Javascript, .NET and Python are now the second and third non-JVM variants of Gremlin to get support for +link:https://tinkerpop.apache.org/docs/3.5.2/reference/#transactions[remote transactions]. -See: link:https://issues.apache.org/jira/browse/TINKERPOP-2556[TINKERPOP-2556] +An example of the .NET `Tx()` syntax can be found in the +link:https://tinkerpop.apache.org/docs/3.5.2/reference/#gremlin-dotnet-transactions[.NET Transaction Section]. + +An example of the Python `tx()` syntax can be found in the +link:https://tinkerpop.apache.org/docs/3.5.2/reference/#gremlin-dotnet-transactions[Python Transaction Section] + + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-2556[TINKERPOP-2556] for .NET and +link:https://issues.apache.org/jira/browse/TINKERPOP-2555[TINKERPOP-2555] for Python ==== datetime() diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml index 87dcaf82955..bbaa75ee852 100644 --- a/gremlin-python/pom.xml +++ b/gremlin-python/pom.xml @@ -29,6 +29,7 @@ limitations under the License. false ${maven.test.skip} + false ${project.parent.basedir}/gremlin-server @@ -216,6 +217,7 @@ limitations under the License. + @@ -224,12 +226,14 @@ limitations under the License. + + @@ -237,6 +241,7 @@ limitations under the License. + @@ -260,6 +265,11 @@ limitations under the License. gremlin-test ${project.version} + + org.apache.tinkerpop + neo4j-gremlin + ${project.version} + org.codehaus.groovy groovy-all @@ -354,6 +364,118 @@ limitations under the License. + + + include-neo4j + + false + + includeNeo4j + + + + true + + + + + org.codehaus.gmavenplus + gmavenplus-plugin + + + org.neo4j + neo4j-tinkerpop-api-impl + 0.9-3.4.0 + + + org.neo4j + neo4j-kernel + + + org.apache.commons + commons-lang3 + + + org.apache.commons + commons-text + + + com.github.ben-manes.caffeine + caffeine + + + org.scala-lang + scala-library + + + org.scala-lang + scala-reflect + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-nop + + + org.apache.lucene + lucene-core + + + io.dropwizard.metrics + metrics-core + + + io.netty + netty-all + + + org.ow2.asm + asm + + + + + org.scala-lang + scala-library + 2.11.8 + + + org.scala-lang + scala-reflect + 2.11.8 + + + org.apache.lucene + lucene-core + 5.5.0 + + + io.dropwizard.metrics + metrics-core + 4.0.2 + + + org.neo4j + neo4j-kernel + 3.4.11 + + + io.netty + netty-all + + + + + + + +