Skip to content

Commit a97d0d0

Browse files
authored
Merge pull request #6510 from FlorentinD/gs-feature-properties-mandatory-22
Remove default value for featureProperties in GraphSage
2 parents 907d888 + 986f75e commit a97d0d0

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

algo/src/main/java/org/neo4j/gds/embeddings/graphsage/algo/GraphSageTrainConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public interface GraphSageTrainConfig extends
6262

6363
long serialVersionUID = 0x42L;
6464

65+
@Override
66+
List<String> featureProperties();
67+
6568
@Override
6669
@Value.Default
6770
default int embeddingDimension() {

algo/src/test/java/org/neo4j/gds/embeddings/graphsage/algo/GraphSageConfigTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,17 @@ void specifyBatchesPerIteration(double samplingRatio, long nodeCount, int expect
7171

7272
@Test
7373
void shouldThrowIfNoPropertiesProvided() {
74-
var mapWrapper = CypherMapWrapper.create(Map.of("modelName", "foo"));
75-
var expectedMessage = "GraphSage requires at least one property.";
74+
assertThatThrownBy(() -> GraphSageTrainConfig.of("", CypherMapWrapper.create(Map.of("modelName", "foo"))))
75+
.isInstanceOf(IllegalArgumentException.class)
76+
.hasMessage("No value specified for the mandatory configuration parameter `featureProperties`");
77+
}
78+
79+
@Test
80+
void shouldThrowIfEmptyPropertiesProvided() {
81+
var mapWrapper = CypherMapWrapper.create(Map.of("modelName", "foo", "featureProperties", List.of()));
7682
assertThatThrownBy(() -> GraphSageTrainConfig.of("", mapWrapper))
7783
.isInstanceOf(IllegalArgumentException.class)
78-
.hasMessage(expectedMessage);
84+
.hasMessage("GraphSage requires at least one property.");
7985
}
8086

8187
@ParameterizedTest
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
| modelName | String | n/a | no | The name of the model to train, must not exist in the Model Catalog.
2-
| featureProperties | List of String | [] | yes | The names of the node properties that should be used as input features. All property names must exist in the projected graph and be of type Float or List of Float.
2+
| featureProperties | List of String | n/a | no | The names of the node properties that should be used as input features. All property names must exist in the projected graph and be of type Float or List of Float.
33
include::partial$/algorithms/common-configuration/common-configuration-entries.adoc[]

0 commit comments

Comments
 (0)