Skip to content
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

TINKERPOP-2978 Implement all() and any() steps. #2228

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Conversation

kenhuuu
Copy link
Contributor

@kenhuuu kenhuuu commented Aug 31, 2023

all() and any() of Proposal 3 are implemented in this PR. The rest will follow in a separate PRs.

Copy link
Contributor

@xiazcy xiazcy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just some documentation fixes

VOTE +1

@GraphComputerVerificationInjectionNotSupported
Scenario: g_injectXabc_cdeX_anyXeqXbcdXX
Given the empty graph
And using the parameter xx1 defined as "l[abc,cde]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any particular reason to use a parameter here? doesn't g.inject(['abc','cde'])... work ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, parameters do work here. I originally wrote these as JUnit tests and when translating them over, I forgot that gremlin-lang allows for square brackets to create lists. Updated them to use this notation instead of parameters for some tests.

And using the parameter xx1 defined as "l[bcd,bcd]"
And the traversal of
"""
g.inject(xx1).all(P.eq("bcd"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests should probably have some negative occurrences like:

g.inject(['bcd','bcd'],['bcd','xyz']).all(P.eq("bcd"))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Negative occurrences is tested by a different scenario. This one was just meant to test that it worked properly with positive occurrences.

@GraphComputerVerificationInjectionNotSupported
Scenario: g_injectXnull_abcX_allXTextP_startingWithXaXX
Given the empty graph
And using the parameter xx1 defined as "l[null,abc]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting the parsers for l[] work like this. i guess it is treating "null" as null and not as a String and treating "abc" without the double quotes as a String somehow?

* @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#all-step" target="_blank">Reference Documentation - All Step</a>
* @since 3.0.0-incubating
*/
public default <S2> GraphTraversal<S, E> all(final P<S2> predicate) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is all step return data type same as input data type? S==E?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they are the same. Did you prefer that I can to just S without E?

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2023

Codecov Report

Merging #2228 (bbf9ca7) into master (e444e77) will increase coverage by 0.34%.
The diff coverage is 90.00%.

@@             Coverage Diff              @@
##             master    #2228      +/-   ##
============================================
+ Coverage     75.86%   76.21%   +0.34%     
- Complexity    12650    12690      +40     
============================================
  Files          1054     1031      -23     
  Lines         64123    60313    -3810     
  Branches       7083     7094      +11     
============================================
- Hits          48645    45965    -2680     
+ Misses        12831    11901     -930     
+ Partials       2647     2447     -200     
Files Coverage Δ
...emlin/language/grammar/TraversalMethodVisitor.java 91.92% <100.00%> (+0.05%) ⬆️
...in/process/traversal/dsl/graph/GraphTraversal.java 93.70% <100.00%> (+1.09%) ⬆️
...kerpop/gremlin/process/traversal/dsl/graph/__.java 79.78% <100.00%> (+0.21%) ⬆️
...gremlin/process/traversal/util/BytecodeHelper.java 86.17% <100.00%> (+0.14%) ⬆️
...gremlin/process/traversal/step/filter/AllStep.java 95.65% <95.65%> (ø)
...gremlin/process/traversal/step/filter/AnyStep.java 95.45% <95.45%> (ø)
...in/language/grammar/DefaultGremlinBaseVisitor.java 0.25% <0.00%> (-0.01%) ⬇️
...process/traversal/translator/PythonTranslator.java 71.42% <33.33%> (-0.60%) ⬇️

... and 29 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Cole-Greer
Copy link
Contributor

Thanks Ken, LGTM

VOTE +1

@kenhuuu kenhuuu merged commit 2bcdb66 into master Sep 25, 2023
@kenhuuu kenhuuu deleted the TINKERPOP-2978 branch September 25, 2023 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants