You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "xiazcy (via GitHub)" <gi...@apache.org> on 2023/08/29 20:56:59 UTC

[GitHub] [tinkerpop] xiazcy opened a new pull request, #2227: Implement trim(), lTrim(), rTrim(), and reverse() String Functions

xiazcy opened a new pull request, #2227:
URL: https://github.com/apache/tinkerpop/pull/2227

   Another set of string function implementations from the [proposal](https://github.com/apache/tinkerpop/blob/master/docs/src/dev/future/proposal-3-remove-closures.asciidoc#string-manipulation-functions-in-tinkerpop). Also not considering scopes at this point. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #2227: Implement trim(), lTrim(), rTrim(), and reverse() String Functions

Posted by "vkagamlyk (via GitHub)" <gi...@apache.org>.
vkagamlyk commented on code in PR #2227:
URL: https://github.com/apache/tinkerpop/pull/2227#discussion_r1319158614


##########
gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/LTrim.feature:
##########
@@ -0,0 +1,87 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+@StepClassMap @StepLTrim
+Feature: Step - lTrim()
+
+  @GraphComputerVerificationInjectionNotSupported
+  Scenario: g_injectX__feature___test__nullX_lTrim
+    Given the empty graph
+    And the traversal of
+      """
+      g.inject("  feature", " one test", null).lTrim()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | feature |
+      | one test |
+      | null |
+
+  @GraphComputerVerificationInjectionNotSupported
+  Scenario: g_injectX__feature__X_lTrim_concatXleft_trimX
+    Given the empty graph
+    And the traversal of
+      """
+      g.inject("  feature  ").lTrim().concat("left_trim")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | feature  left_trim |
+
+  @GraphComputerVerificationInjectionNotSupported
+  Scenario: g_injectXListXa_bXX_lTrim
+    Given the empty graph
+    And using the parameter xx1 defined as "l[a,b]"
+    And the traversal of
+    """
+    g.inject(xx1).lTrim()
+    """
+    When iterated to list
+    Then the traversal will raise an error with message containing text of "The lTrim() step can only take string as argument"
+
+  Scenario: g_V_valuesXnameX_ltrim_concatXleft_trimX
+    Given the empty graph
+    And the graph initializer of

Review Comment:
   ahh, it's modified modern graph
   sorry, I missed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on pull request #2227: Implement trim(), lTrim(), rTrim(), and reverse() String Functions

Posted by "vkagamlyk (via GitHub)" <gi...@apache.org>.
vkagamlyk commented on PR #2227:
URL: https://github.com/apache/tinkerpop/pull/2227#issuecomment-1710780594

   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #2227: Implement trim(), lTrim(), rTrim(), and reverse() String Functions

Posted by "vkagamlyk (via GitHub)" <gi...@apache.org>.
vkagamlyk commented on code in PR #2227:
URL: https://github.com/apache/tinkerpop/pull/2227#discussion_r1319125560


##########
gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/LTrim.feature:
##########
@@ -0,0 +1,87 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+@StepClassMap @StepLTrim
+Feature: Step - lTrim()
+
+  @GraphComputerVerificationInjectionNotSupported
+  Scenario: g_injectX__feature___test__nullX_lTrim
+    Given the empty graph
+    And the traversal of
+      """
+      g.inject("  feature", " one test", null).lTrim()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | feature |
+      | one test |
+      | null |
+
+  @GraphComputerVerificationInjectionNotSupported
+  Scenario: g_injectX__feature__X_lTrim_concatXleft_trimX
+    Given the empty graph
+    And the traversal of
+      """
+      g.inject("  feature  ").lTrim().concat("left_trim")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | feature  left_trim |
+
+  @GraphComputerVerificationInjectionNotSupported
+  Scenario: g_injectXListXa_bXX_lTrim
+    Given the empty graph
+    And using the parameter xx1 defined as "l[a,b]"
+    And the traversal of
+    """
+    g.inject(xx1).lTrim()
+    """
+    When iterated to list
+    Then the traversal will raise an error with message containing text of "The lTrim() step can only take string as argument"
+
+  Scenario: g_V_valuesXnameX_ltrim_concatXleft_trimX
+    Given the empty graph
+    And the graph initializer of

Review Comment:
   why not to use modern graph?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] kenhuuu commented on pull request #2227: Implement trim(), lTrim(), rTrim(), and reverse() String Functions

Posted by "kenhuuu (via GitHub)" <gi...@apache.org>.
kenhuuu commented on PR #2227:
URL: https://github.com/apache/tinkerpop/pull/2227#issuecomment-1710864624

   VOTE +1. Consider adding tests for empty string here as well.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] codecov-commenter commented on pull request #2227: Implement trim(), lTrim(), rTrim(), and reverse() String Functions

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2227:
URL: https://github.com/apache/tinkerpop/pull/2227#issuecomment-1698098425

   ## [Codecov](https://app.codecov.io/gh/apache/tinkerpop/pull/2227?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#2227](https://app.codecov.io/gh/apache/tinkerpop/pull/2227?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (afb3ed6) into [master](https://app.codecov.io/gh/apache/tinkerpop/commit/02bf879ccb64dce482277c1d7033a19489a2fbef?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (02bf879) will **decrease** coverage by `5.10%`.
   > The diff coverage is `60.00%`.
   
   > :exclamation: Current head afb3ed6 differs from pull request most recent head 356e10b. Consider uploading reports for the commit 356e10b to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2227      +/-   ##
   ============================================
   - Coverage     75.79%   70.69%   -5.10%     
   ============================================
     Files          1039       24    -1015     
     Lines         63528     3587   -59941     
     Branches       7044        0    -7044     
   ============================================
   - Hits          48152     2536   -45616     
   + Misses        12761      883   -11878     
   + Partials       2615      168    -2447     
   ```
   
   
   | [Files Changed](https://app.codecov.io/gh/apache/tinkerpop/pull/2227?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [gremlin-go/driver/anonymousTraversal.go](https://app.codecov.io/gh/apache/tinkerpop/pull/2227?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JlbWxpbi1nby9kcml2ZXIvYW5vbnltb3VzVHJhdmVyc2FsLmdv) | `44.30% <0.00%> (-1.55%)` | :arrow_down: |
   | [gremlin-go/driver/graphTraversal.go](https://app.codecov.io/gh/apache/tinkerpop/pull/2227?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JlbWxpbi1nby9kcml2ZXIvZ3JhcGhUcmF2ZXJzYWwuZ28=) | `86.24% <100.00%> (+0.37%)` | :arrow_up: |
   
   ... and [1015 files with indirect coverage changes](https://app.codecov.io/gh/apache/tinkerpop/pull/2227/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] xiazcy merged pull request #2227: Implement trim(), lTrim(), rTrim(), and reverse() String Functions

Posted by "xiazcy (via GitHub)" <gi...@apache.org>.
xiazcy merged PR #2227:
URL: https://github.com/apache/tinkerpop/pull/2227


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] xiazcy commented on a diff in pull request #2227: Implement trim(), lTrim(), rTrim(), and reverse() String Functions

Posted by "xiazcy (via GitHub)" <gi...@apache.org>.
xiazcy commented on code in PR #2227:
URL: https://github.com/apache/tinkerpop/pull/2227#discussion_r1319157785


##########
gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/LTrim.feature:
##########
@@ -0,0 +1,87 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+@StepClassMap @StepLTrim
+Feature: Step - lTrim()
+
+  @GraphComputerVerificationInjectionNotSupported
+  Scenario: g_injectX__feature___test__nullX_lTrim
+    Given the empty graph
+    And the traversal of
+      """
+      g.inject("  feature", " one test", null).lTrim()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | feature |
+      | one test |
+      | null |
+
+  @GraphComputerVerificationInjectionNotSupported
+  Scenario: g_injectX__feature__X_lTrim_concatXleft_trimX
+    Given the empty graph
+    And the traversal of
+      """
+      g.inject("  feature  ").lTrim().concat("left_trim")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | feature  left_trim |
+
+  @GraphComputerVerificationInjectionNotSupported
+  Scenario: g_injectXListXa_bXX_lTrim
+    Given the empty graph
+    And using the parameter xx1 defined as "l[a,b]"
+    And the traversal of
+    """
+    g.inject(xx1).lTrim()
+    """
+    When iterated to list
+    Then the traversal will raise an error with message containing text of "The lTrim() step can only take string as argument"
+
+  Scenario: g_V_valuesXnameX_ltrim_concatXleft_trimX
+    Given the empty graph
+    And the graph initializer of

Review Comment:
   I wanted to demonstrate trimming of properties with existing leading and trailing spaces, only the empty graph is reset, all other graphs are shared so we shouldn't modify them



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org