[gremlin-dotnet] Handle non-bulked results in remote traversals#3525
Open
xiazcy wants to merge 2 commits into
Open
[gremlin-dotnet] Handle non-bulked results in remote traversals#3525xiazcy wants to merge 2 commits into
xiazcy wants to merge 2 commits into
Conversation
Remote traversals assumed every result was a Traverser and threw InvalidCastException on non-bulked scalar responses (bulkResults=false). Wrap raw values in a Traverser at the iteration boundary, matching the Java, Python, Go, and JavaScript drivers. Assisted-by: Kiro:claude-opus-4-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
gremlin-dotnetremote traversal path (DriverRemoteConnection/TransactionRemoteConnection) assumed every server result was aTraverser. It submitted asSubmitAsync<Traverser>, soResultSet<Traverser>performed an unconditional(Traverser)itemcast during iteration.When a compatible HTTP endpoint returns non-bulked results, e.g. a raw
Int64forg.V().count(), or any traversal run withbulkResults=false, the values arrive as raw scalars rather thanTraverserinstances, and the cast throwsInvalidCastException. In effect,bulkResults=falsewas unusable on the remote traversal path.Fix
Submit as
SubmitAsync<object>and adapt the stream at the iteration boundary: passTraverserinstances through unchanged, and wrap raw values innew Traverser(item, 1). This mirrors the other GLVs. The genericResultSet<T>and the plainclient.SubmitAsync<T>path are unchanged.Testing
Traverserexpansion, and a mixed stream (DriverRemoteConnectionTests).bulkResults=falsefor a single scalar (count) and multi-result (values) case (GraphTraversalTests).bulkResultstrue/false behavior (GremlinClientTests), matching the Go driver's coverage.VOTE +1