This is an automated email from the ASF dual-hosted git repository. xiazcy pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 08a8c439c980dbc817056eee641792d7ae8cf834 Merge: 29dd43fde4 3c04c9bb01 Author: Yang Xia <[email protected]> AuthorDate: Mon Jul 20 13:11:30 2026 -0700 Merge branch '3.8-dev' docs/src/dev/provider/gremlin-semantics.asciidoc | 14 ++++++++++---- docs/src/reference/the-traversal.asciidoc | 13 +++++++------ docs/src/upgrade/release-3.8.0.asciidoc | 9 ++++++--- 3 files changed, 23 insertions(+), 13 deletions(-) diff --cc docs/src/dev/provider/gremlin-semantics.asciidoc index 5ccfcd9112,1fc85258a4..a66e3fe69d --- a/docs/src/dev/provider/gremlin-semantics.asciidoc +++ b/docs/src/dev/provider/gremlin-semantics.asciidoc @@@ -908,34 -809,28 +908,40 @@@ link:https://tinkerpop.apache.org/docs/ [[asNumber-step]] === asNumber() - *Description:* converts the incoming traverser to the nearest parsable type if no argument is provided, or to the desired numerical type, based on the number token (`N`) provided. + *Description:* converts the incoming traverser to the nearest parsable type if no argument is provided, or to the desired numerical type, based on the type token (`GType`) provided. -*Syntax:* `asNumber()` | `asNumber(GType typeToken)` +*Syntax:* `asNumber()` | `asNumber(typeToken: GType)` [width="100%",options="header"] |========================================================= |Start Step |Mid Step |Modulated |Domain |Range - |N |Y |N |`NUMBER`/`STRING` |`NUMBER` -|N |Y |N |`Number`/`String`/`Date` |`Number` ++|N |Y |N |`NUMBER`/`STRING`/`DATE` |`NUMBER` |========================================================= *Arguments:* * `typeToken` - The enum `GType` to denote the desired type to parse/cast to. -If no type token is provided, the incoming number remains unchanged. A `Date` input is converted to milliseconds since epoch. A `null` input passes through as `null`. +*Modulation:* -*Exceptions* +None + +*Considerations:* + - If no type token is provided, the incoming number remains unchanged. ++*Modulation:* ++ ++None ++ ++*Considerations:* ++ ++If no type token is provided, the incoming number remains unchanged. A `DATE` input is converted to milliseconds since epoch. A `null` input passes through as `null`. -* If any overflow occurs during narrowing of types, then an `ArithmeticException` will be thrown. -* If the incoming string cannot be parsed into a valid number format, then a `NumberFormatException` will be thrown. -* If the incoming traverser is a non-String/Number/Date value then an `IllegalArgumentException` will be thrown. -* If the supplied type token is not a number type, then an `IllegalArgumentException` will be thrown. +*Exceptions:* + +* If any overflow occurs during narrowing of types, an `Arithmetic Error` is raised. +* If the incoming string cannot be parsed into a valid number format, an `Argument Error` is raised. - * If the incoming traverser is a non-`STRING`/`NUMBER` (including `null`) value then an `Argument Error` is raised. ++* If the incoming traverser is a non-`STRING`/`NUMBER`/`DATE` value then an `Argument Error` is raised. +* If the supplied type token is not a number type, then an `Argument Error` is raised. See: link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AsNumberStep.java[source], link:https://tinkerpop.apache.org/docs/x.y.z/reference/#asNumber-step[reference]
