Skip to content

TINKERPOP-3147 Prevent aggregate step from having multiple by modulators #3096

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

Closed
wants to merge 11 commits into from

Conversation

EchoNullify
Copy link
Contributor

TARGET 3.8-dev

https://issues.apache.org/jira/browse/TINKERPOP-3147

Prevent multiple by operators from being used for aggregate step by throwing IllegalStateException if modulateBy is called more than once.

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (3.8-dev@619e1f7). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             3.8-dev    #3096   +/-   ##
==========================================
  Coverage           ?   76.33%           
  Complexity         ?    14013           
==========================================
  Files              ?     1105           
  Lines              ?    69743           
  Branches           ?     7514           
==========================================
  Hits               ?    53235           
  Misses             ?    13752           
  Partials           ?     2756           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -69,6 +69,10 @@ public String toString() {

@Override
public void modulateBy(final Traversal.Admin<?, ?> aggregateTraversal) {
if (this.aggregateTraversal != null)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

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

@@ -87,6 +87,10 @@ public List<Traversal.Admin<S, Object>> getLocalChildren() {

@Override
public void modulateBy(final Traversal.Admin<?, ?> storeTraversal) {
if (this.storeTraversal != null)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

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

g.V().aggregate("x").by("name").by("age").cap("x")
"""
When iterated to list
Then the traversal will raise an error
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that #3094 is merged you should be able to check that the error message contains an expected phrase

@@ -24,7 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
=== TinkerPop 3.8.0 (Release Date: NOT OFFICIALLY RELEASED YET)

This release also includes changes from <<release-3-7-XXX, 3.7.XXX>>.

* Changed aggregate step to not allowing multiple by modulators.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit (grammar): 'not allow'

@Cole-Greer
Copy link
Contributor

VOTE +1 (pending resolution to @andreachild's above comments)

@Cole-Greer
Copy link
Contributor

Note: This change should be reflected user upgrade docs. There are quite a few of these by-modulating changes going into 3.8 right now, perhaps they should all be consolidated into a single upgrade docs entry once all of that work is complete.

@EchoNullify EchoNullify closed this May 2, 2025
@EchoNullify EchoNullify deleted the aggregateby branch May 2, 2025 21:59
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.

4 participants