-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed GenericLiteralVisitor to treat float literals as Double by default #3074
Merged
Conversation
This file contains 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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 3.8-dev #3074 +/- ##
==========================================
Coverage ? 76.36%
Complexity ? 13236
==========================================
Files ? 1062
Lines ? 61577
Branches ? 7347
==========================================
Hits ? 47022
Misses ? 12035
Partials ? 2520 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c3f33b0
to
315195c
Compare
VOTE +1 |
aea2fa9
to
b01d3b3
Compare
VOTE +1 |
kenhuuu
reviewed
Mar 18, 2025
kenhuuu
reviewed
Mar 18, 2025
...e/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/GeneralLiteralVisitorTest.java
Show resolved
Hide resolved
kenhuuu
reviewed
Mar 18, 2025
...lin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
Outdated
Show resolved
Hide resolved
VOTE +1 |
…in Gremlin Lang (e.g., 1.0 or -123.456), it's automatically converted to a BigDecimal. This differs from most programming languages where floating-point literals are typically treated as double-precision values. To align the behavior of Gremlin Lang with common programming language conventions and user expectations, this changeset changes GremlinLangScriptEngine via GenericLiteralVisitor to treat float literals without explicit type suffixes (like 'm', 'f', or 'd') as Double by default. Users who need BigDecimal precision can still use the 'm' suffix (e.g., 1.0m).
1944e3e
to
179f8d6
Compare
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.
Currently, when a floating-point number is provided without a suffix in Gremlin Lang (e.g., 1.0 or -123.456), it's automatically converted to a BigDecimal. This differs from most programming
languages where floating-point literals are typically treated as double-precision values.
To align the behavior of Gremlin Lang with common programming language conventions and user expectations, this changeset changes
GremlinLangScriptEngine
viaGenericLiteralVisitor
to treat float literals without explicit type suffixes (like 'm', 'f', or 'd') as Double by default. Users who need BigDecimal precision can still use the 'm' suffix (e.g., 1.0m). Gremlin Groovy will still default to BigDecimal for float literals.