[
https://issues.apache.org/jira/browse/TINKERPOP-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17928207#comment-17928207
]
ASF GitHub Bot commented on TINKERPOP-2966:
-------------------------------------------
andreachild commented on code in PR #3039:
URL: https://github.com/apache/tinkerpop/pull/3039#discussion_r1960638400
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/translator/PythonTranslator.java:
##########
@@ -479,9 +467,28 @@ private SymbolHelper() {
}
public static String toPython(final String symbol) {
- // at some point we will want a camel to snake case converter
here. for now the only step that needs
- // this conversion is mergeE/V related as the rest still continue
use in their deprecated forms.
- return TO_PYTHON_MAP.getOrDefault(symbol, symbol);
+ return TO_PYTHON_MAP.getOrDefault(symbol,
convertCamelCaseToSnakeCase(symbol));
+ }
+
+ public static String convertCamelCaseToSnakeCase(final String
camelCase) {
+ if (camelCase == null || camelCase.isEmpty())
Review Comment:
Nit: you can use `StringUtils.isBlank(camelCase)` which will also check for
other types of whitespace.
> Change PythonTranslator to generate underscore based step naming
> ----------------------------------------------------------------
>
> Key: TINKERPOP-2966
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2966
> Project: TinkerPop
> Issue Type: Improvement
> Components: translator
> Affects Versions: 3.5.6
> Reporter: Stephen Mallette
> Priority: Minor
>
> The more idiomatic underscore based step naming was introduced a long time
> ago but the {{PythonTranslator}}} still produces the old camelcase style.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)