L0Lmaker opened a new pull request, #3430:
URL: https://github.com/apache/tinkerpop/pull/3430
## Summary
Backport of #3416 to `3.7-dev`. Adds `Traversal.NextN(n int) ([]*Result,
error)`
to gremlin-go for batched result iteration, providing API parity with
`next(n)`
in the Java, Python, and .NET GLVs.
- Behavior matches the Java reference: returns up to `n` results, returns
what is
available if fewer exist, returns an empty slice for `n <= 0`, and surfaces
`ResultSet` errors to the caller.
- Method is named `NextN` rather than `Next(n int)` because Go does not
support
method overloading. The Go variants reference doc is updated to call this
out.
Scope vs. #3416: the master PR also updated the Go translators in
`gremlin-core`
(`GoTranslateVisitor.java`) and `gremlin-js` (`GoTranslateVisitor.ts`) to
emit
`NextN(n)` for the batched terminal form. Those translator files do not
exist on
`3.7-dev`, so the backport correctly omits those changes.
## JIRA
[TINKERPOP-3244](https://issues.apache.org/jira/browse/TINKERPOP-3244)
## 3.8 backport
A separate PR for `3.8-dev` will follow after the `3.7-dev → 3.8-dev` flow-up
merge brings the `gremlin-go` portion forward. The follow-up PR will be
scoped
to the `3.8`-only delta: the `GoTranslateVisitor.java` update and the
corresponding 3.8.2 CHANGELOG entry. Keeping the two PRs separated this way
avoids overlap with the flow-up merge.
## Test plan
- [x] `go build ./...` clean
- [x] `go vet ./driver/` clean
- [x] `gofmt -l driver/traversal.go driver/traversal_test.go` clean
- [x] `TestTraversalNextN` — all 9 subtests pass: `n < available`, `n ==
available`,
`n > available`, `n = 0`, `n < 0`, exhausted traversal, bulked
traverser
unrolling across batch boundary, repeated drain calls, error
propagation
- [x] Existing no-server tests (`TestTraversal/Test_clone_traversal`,
`TestTraversal/Test_Iterate_with_empty_removeConnection`) still pass
- [x] Full `build-test.yml` CI matrix on the fork (smoke, java jdk8/11/17,
gremlin-server-default/-unified, gremlin-console, gremlin-driver,
hadoop,
spark, neo4j, javascript, python, dotnet, go) all green at `4722890`
- [ ] Full integration suite via `./run.sh` — not run locally; relying on
fork CI's
`go` job which executes the gremlin-go test container
## Notes
This change was AI-assisted; the commit includes the `Assisted-by:` trailer
per `AGENTS.md`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]