Skip to content

Commit

Permalink
Fix doc tests for CypherAggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthMax committed May 17, 2024
1 parent d2d12fc commit a17e2da
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
package org.neo4j.gds.projection;

import org.neo4j.gds.annotation.CustomProcedure;
import org.neo4j.gds.api.DatabaseId;
import org.neo4j.gds.compat.GraphDatabaseApiProxy;
import org.neo4j.gds.compat.Neo4jProxy;
Expand All @@ -33,6 +34,9 @@
import org.neo4j.kernel.api.procedure.CallableUserAggregationFunction;
import org.neo4j.kernel.api.procedure.Context;
import org.neo4j.kernel.impl.api.KernelTransactions;
import org.neo4j.procedure.Name;
import org.neo4j.values.AnyValue;
import org.neo4j.values.storable.TextValue;

import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -80,6 +84,20 @@ public UserFunctionSignature signature() {
);
}

// NOTE: keep in sync with `FUNCTION_NAME` and `signature`
@CustomProcedure(value = "gds.alpha.graph.project", namespace = CustomProcedure.Namespace.AGGREGATION_FUNCTION)
public AggregationResult procedureSyntax(
@Name("graphName") TextValue graphName,
@Name("sourceNode") AnyValue sourceNode,
@Name("targetNode") AnyValue targetNode,
@Name("nodesConfig") AnyValue nodesConfig,
@Name("relationshipConfig") AnyValue relationshipConfig,
@Name("configuration") AnyValue config
) {
throw new UnsupportedOperationException("This method is only used to document the procedure syntax.");
}


@Override
public UserAggregationReducer createReducer(Context ctx) throws ProcedureException {
var databaseService = ctx.graphDatabaseAPI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
package org.neo4j.gds.projection;

import org.neo4j.gds.annotation.CustomProcedure;
import org.neo4j.gds.api.DatabaseId;
import org.neo4j.gds.compat.GraphDatabaseApiProxy;
import org.neo4j.gds.compat.Neo4jProxy;
Expand All @@ -33,6 +34,9 @@
import org.neo4j.kernel.api.procedure.CallableUserAggregationFunction;
import org.neo4j.kernel.api.procedure.Context;
import org.neo4j.kernel.impl.api.KernelTransactions;
import org.neo4j.procedure.Name;
import org.neo4j.values.AnyValue;
import org.neo4j.values.storable.TextValue;

import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -80,6 +84,18 @@ public UserFunctionSignature signature() {
);
}

// NOTE: keep in sync with `FUNCTION_NAME` and `signature`
@CustomProcedure(value = "gds.graph.project", namespace = CustomProcedure.Namespace.AGGREGATION_FUNCTION)
public AggregationResult procedureSyntax(
@Name("graphName") TextValue graphName,
@Name("sourceNode") AnyValue sourceNode,
@Name("targetNode") AnyValue targetNode,
@Name("dataConfig") AnyValue dataConfig,
@Name("configuration") AnyValue config
) {
throw new UnsupportedOperationException("This method is only used to document the procedure syntax.");
}

@Override
public UserAggregationReducer createReducer(Context ctx) throws ProcedureException {
var databaseService = ctx.graphDatabaseAPI();
Expand Down

0 comments on commit a17e2da

Please sign in to comment.