You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "EchoNullify (via GitHub)" <gi...@apache.org> on 2025/04/11 22:47:11 UTC

[PR] TINKERPOP-3150 Prevent sample step from having multiple by modulators [tinkerpop]

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

   TARGET  3.8-dev
   
   https://issues.apache.org/jira/browse/TINKERPOP-3150
   
   Prevent multiple by operators from being used for sample step  by throwing IllegalStateException if modulateBy is called more than once.


-- 
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


Re: [PR] TINKERPOP-3150 Prevent sample step from having multiple by modulators [tinkerpop]

Posted by "EchoNullify (via GitHub)" <gi...@apache.org>.
EchoNullify closed pull request #3093: TINKERPOP-3150 Prevent sample step from having multiple by modulators
URL: https://github.com/apache/tinkerpop/pull/3093


-- 
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


Re: [PR] TINKERPOP-3150 Prevent sample step from having multiple by modulators [tinkerpop]

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


##########
CHANGELOG.asciidoc:
##########
@@ -60,6 +60,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 [[release-3-7-4]]
 === TinkerPop 3.7.4 (NOT OFFICIALLY RELEASED YET)
 
+* Changed sample step to not allowing multiple by modulators.

Review Comment:
   This should go into the 3.8 section, not 3.7.4



-- 
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


Re: [PR] TINKERPOP-3150 Prevent sample step from having multiple by modulators [tinkerpop]

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


##########
gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Sample.feature:
##########
@@ -18,6 +18,15 @@
 @StepClassFilter @StepSample
 Feature: Step - sample()
 
+  Scenario: g_V_sampleX1X_byXageX_byXT_idX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().sample(1).by("age").by(T.id)
+      """
+    When iterated to list
+    Then the traversal will raise an error

Review Comment:
   Now that https://github.com/apache/tinkerpop/pull/3094 is merged you should be able to do this:
   
   ```
    Scenario: g_V_sampleX1X_byXageX_byXT_idX
       Given the modern graph
       And the traversal of
         """
         g.V().sample(1).by("age").by(T.id)
         """
       Then the traversal will raise an error with message containing text of "Sample step can only have one by modulator"
   ```



-- 
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


Re: [PR] TINKERPOP-3150 Prevent sample step from having multiple by modulators [tinkerpop]

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


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SampleGlobalStep.java:
##########
@@ -68,6 +69,10 @@ public List<Traversal.Admin<S, Number>> getLocalChildren() {
 
     @Override
     public void modulateBy(final Traversal.Admin<?, ?> probabilityTraversal) {
+        if (this.probabilityTraversal != initialTraversal)
+        {

Review Comment:
   Nit: following existing syntax conventions this curly brace should be on the same line as the if statement



-- 
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


Re: [PR] TINKERPOP-3150 Prevent sample step from having multiple by modulators [tinkerpop]

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


##########
CHANGELOG.asciidoc:
##########
@@ -60,6 +60,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 [[release-3-7-4]]
 === TinkerPop 3.7.4 (NOT OFFICIALLY RELEASED YET)
 
+* Changed sample step to not allowing multiple by modulators.

Review Comment:
   Nit (grammar): should be 'to not allow' multiple by modulators



-- 
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


Re: [PR] TINKERPOP-3150 Prevent sample step from having multiple by modulators [tinkerpop]

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


##########
gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Sample.feature:
##########
@@ -18,6 +18,15 @@
 @StepClassFilter @StepSample
 Feature: Step - sample()
 
+  Scenario: g_V_sampleX1X_byXageX_byXT_idX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().sample(1).by("age").by(T.id)
+      """
+    When iterated to list
+    Then the traversal will raise an error

Review Comment:
   Now that https://github.com/apache/tinkerpop/pull/3094 is merged you should be able to do this:
   
   ```
    Scenario: g_V_sampleX1X_byXageX_byXT_idX
       Given the modern graph
       And the traversal of
         """
         g.V().sample(1).by("age").by(T.id)
         """
       When iterated to list
       Then the traversal will raise an error with message containing text of "Sample step can only have one by modulator"
   ```



-- 
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


Re: [PR] TINKERPOP-3150 Prevent sample step from having multiple by modulators [tinkerpop]

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


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SampleGlobalStep.java:
##########
@@ -68,6 +69,10 @@ public List<Traversal.Admin<S, Number>> getLocalChildren() {
 
     @Override
     public void modulateBy(final Traversal.Admin<?, ?> probabilityTraversal) {
+        if (this.probabilityTraversal != initialTraversal)

Review Comment:
   Can you please add a unit test for this to `SampleGlobalStepTest.java`? 



-- 
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


Re: [PR] TINKERPOP-3150 Prevent sample step from having multiple by modulators [tinkerpop]

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

   ## [Codecov](https://app.codecov.io/gh/apache/tinkerpop/pull/3093?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`3.8-dev@619e1f7`). [Learn more](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#section-missing-base-commit) about missing BASE report.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             3.8-dev    #3093   +/-   ##
   ==========================================
     Coverage           ?   74.94%           
   ==========================================
     Files              ?       28           
     Lines              ?     6139           
     Branches           ?        0           
   ==========================================
     Hits               ?     4601           
     Misses             ?     1330           
     Partials           ?      208           
   ```
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/tinkerpop/pull/3093?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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