Skip to content

TINKERPOP-3233 Go support for escaped characters#3381

Open
GumpacG wants to merge 1 commit intoapache:masterfrom
GumpacG:TINKERPOP-3233-go
Open

TINKERPOP-3233 Go support for escaped characters#3381
GumpacG wants to merge 1 commit intoapache:masterfrom
GumpacG:TINKERPOP-3233-go

Conversation

@GumpacG
Copy link
Copy Markdown

@GumpacG GumpacG commented Apr 8, 2026

https://issues.apache.org/jira/browse/TINKERPOP-3233
This is the first part of resolving the ticket.

This change fixes a bug in Go in which characters that should be escaped are being replaced by a dot.
Bug:
The traversal result, err := g.V().Has(vertexLabel, "name", "m m").Next() would generate the GremlinLang g.V().has(vertexLabel, "name", "m.m").next().
New behaviour:
The traversal result, err := g.V().Has(vertexLabel, "name", "m m").Next() would generate the GremlinLang g.V().has(vertexLabel, "name", "m\tm").next().

A test has been added to gremlinlang_test.go for testing all cases that should be escaped.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.25%. Comparing base (cfd6889) to head (416de79).
⚠️ Report is 990 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3381      +/-   ##
============================================
- Coverage     77.87%   76.25%   -1.63%     
+ Complexity    13578    13313     -265     
============================================
  Files          1015     1011       -4     
  Lines         59308    59832     +524     
  Branches       6835     7004     +169     
============================================
- Hits          46184    45622     -562     
- Misses        10817    11527     +710     
- Partials       2307     2683     +376     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +679 to +681
return g.V().Has("name", "\"marko\n\r\t\b\f\"")
},
equals: "g.V().has(\"name\",\"\\\"marko\\n\\r\\t\\b\\f\\\"\")",
Copy link
Copy Markdown
Contributor

@Cole-Greer Cole-Greer Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Throw a single quote in there too

Suggested change
return g.V().Has("name", "\"marko\n\r\t\b\f\"")
},
equals: "g.V().has(\"name\",\"\\\"marko\\n\\r\\t\\b\\f\\\"\")",
return g.V().Has("name", "\"marko\n\r\t\b\f\'")
},
equals: "g.V().has(\"name\",\"\\\"marko\\n\\r\\t\\b\\f\\\'\")",

@Cole-Greer
Copy link
Copy Markdown
Contributor

Thanks @GumpacG, LGTM. VOTE +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants