This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch 3.7-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/3.7-dev by this push:
     new dd36b7a0a2 Document product()-step return type and Map argument 
behavior
dd36b7a0a2 is described below

commit dd36b7a0a203727d6aec3112dd23c2b4b894a193
Author: Stephen Mallette <[email protected]>
AuthorDate: Mon Jul 27 21:42:23 2026 +0000

    Document product()-step return type and Map argument behavior
    
    The reference documentation for the product()-step did not describe the
    shape of its result. It now states that the result is a List whose
    elements are each a two-element List, one for each combination of an item
    from the incoming list with an item from the argument list, and that
    element order and duplicates are preserved. It also notes that a Map
    argument is rejected with an IllegalArgumentException, since a Map is
    neither an array nor an Iterable.
    
    Assisted-by: Kiro:claude-opus-4.8
---
 docs/src/reference/the-traversal.asciidoc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/src/reference/the-traversal.asciidoc 
b/docs/src/reference/the-traversal.asciidoc
index e93333cfef..e92247fa67 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -3601,8 +3601,11 @@ 
link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gre
 === Product Step
 
 The `product()`-step (*map*) calculates the cartesian product between the 
incoming list traverser and the provided list
-argument. This step only expects list data (array or Iterable) and will throw 
an `IllegalArgumentException` if any
-other type is encountered (including `null`).
+argument. The result is returned as a `List` in which each element is itself a 
two-element `List` pairing one item from
+the incoming list with one item from the argument list, so element order and 
duplicates are preserved. This step only
+expects list data (array or Iterable) as input and will throw an 
`IllegalArgumentException` if any other type is
+encountered (including `null`). A `Map` is not accepted and will also throw an 
`IllegalArgumentException`, as it is
+neither an array nor an `Iterable`.
 
 [gremlin-groovy,modern]
 ----

Reply via email to