Skip to content

Commit 9692a74

Browse files
committed
Allow null new label for map processor.
1 parent 80b2a82 commit 9692a74

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

query-engine/docs/query-engine-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ services:
5959
- 14268:14268
6060

6161
query-engine:
62-
image: ghcr.io/yaytay/query-engine-design-mode:0.0.40-main
62+
image: ghcr.io/yaytay/query-engine-design-mode:0.0.41-main
6363
ports:
6464
- 2000:8080
6565
volumes:

query-engine/src/main/java/uk/co/spudsoft/query/defn/ProcessorMapLabel.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ public void validate() throws IllegalArgumentException {
4343
if (Strings.isNullOrEmpty(sourceLabel)) {
4444
throw new IllegalArgumentException("No source field name provided for relabel");
4545
}
46-
if (newLabel == null) {
47-
throw new IllegalArgumentException("No new field name provided for relabel - the new field name may be an empty string but cannot be null");
48-
}
4946
}
5047

5148
/**
@@ -67,11 +64,11 @@ public String getSourceLabel() {
6764
/**
6865
* The new name of the field, may be blank to remove a field.
6966
* <p>
70-
* This value may not be null, but may be blank.
67+
* This value may be null or blank, both of which will remove the field from the stream.
7168
* @return the new name of the field, may be blank to remove a field.
7269
*/
7370
@Schema(description = """
74-
The new name of the field, may be blank to remove a field.
71+
The new name of the field, may be null or blank, both of which will remove the field from the stream.
7572
"""
7673
, maxLength = 100
7774
, requiredMode = Schema.RequiredMode.REQUIRED

query-engine/src/main/java/uk/co/spudsoft/query/main/Version.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public final class Version {
3434
/**
3535
* The project version, as set in the Maven pom.xml.
3636
*/
37-
public static final String MAVEN_PROJECT_VERSION = "0.0.40-main";
37+
public static final String MAVEN_PROJECT_VERSION = "0.0.41-main";
3838

3939
private Version() {
4040
}

query-engine/src/test/java/uk/co/spudsoft/query/defn/ProcessorMapTest.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ public void testValidate() {
6262
assertThrows(IllegalArgumentException.class, () -> {
6363
ProcessorMap.builder().relabels(Arrays.asList(ProcessorMapLabel.builder().build())).build().validate();
6464
}, "Zero relabels provided");
65-
assertThrows(IllegalArgumentException.class, () -> {
66-
ProcessorMap.builder().relabels(Arrays.asList(ProcessorMapLabel.builder().sourceLabel("source").build())).build().validate();
67-
}, "Zero relabels provided");
65+
ProcessorMap.builder().relabels(Arrays.asList(ProcessorMapLabel.builder().sourceLabel("source").build())).build().validate();
6866
ProcessorMap.builder().relabels(Arrays.asList(ProcessorMapLabel.builder().sourceLabel("source").newLabel("new").build())).build().validate();
6967
}
7068

0 commit comments

Comments
 (0)