You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2024/11/19 13:28:19 UTC
(streampipes) branch dev updated: fix: Fix pipeline element validation for collections (#3340)
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 128d948d6e fix: Fix pipeline element validation for collections (#3340)
128d948d6e is described below
commit 128d948d6ed67d924305f4049b16dd3ce3d6cadd
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Tue Nov 19 14:28:14 2024 +0100
fix: Fix pipeline element validation for collections (#3340)
---
.../internal/jvm/datalake/DataLakeDimensionProvider.java | 11 +++++++----
.../manager/matching/v2/pipeline/CheckCompletedVisitor.java | 8 +++++++-
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/streampipes-extensions/streampipes-sinks-internal-jvm/src/main/java/org/apache/streampipes/sinks/internal/jvm/datalake/DataLakeDimensionProvider.java b/streampipes-extensions/streampipes-sinks-internal-jvm/src/main/java/org/apache/streampipes/sinks/internal/jvm/datalake/DataLakeDimensionProvider.java
index 17ed2b9c87..aaa444db3e 100644
--- a/streampipes-extensions/streampipes-sinks-internal-jvm/src/main/java/org/apache/streampipes/sinks/internal/jvm/datalake/DataLakeDimensionProvider.java
+++ b/streampipes-extensions/streampipes-sinks-internal-jvm/src/main/java/org/apache/streampipes/sinks/internal/jvm/datalake/DataLakeDimensionProvider.java
@@ -55,10 +55,13 @@ public class DataLakeDimensionProvider {
private void addFieldIfNotExists(EventPropertyPrimitive field,
List<Option> options) {
if (options.stream().noneMatch(o -> o.getName().equals(field.getRuntimeName()))) {
- options.add(new Option(
- field.getRuntimeName(),
- PropertyScope.valueOf(field.getPropertyScope()) == PropertyScope.DIMENSION_PROPERTY)
- );
+ if (field.getPropertyScope() != null) {
+ options.add(new Option(
+ field.getRuntimeName(),
+ PropertyScope.valueOf(field.getPropertyScope()) == PropertyScope.DIMENSION_PROPERTY
+ )
+ );
+ }
}
}
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/pipeline/CheckCompletedVisitor.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/pipeline/CheckCompletedVisitor.java
index fadbd19ecb..63440e7ca5 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/pipeline/CheckCompletedVisitor.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/pipeline/CheckCompletedVisitor.java
@@ -21,6 +21,7 @@ package org.apache.streampipes.manager.matching.v2.pipeline;
import org.apache.streampipes.model.pipeline.PipelineElementValidationInfo;
import org.apache.streampipes.model.staticproperty.AnyStaticProperty;
import org.apache.streampipes.model.staticproperty.CodeInputStaticProperty;
+import org.apache.streampipes.model.staticproperty.CollectionStaticProperty;
import org.apache.streampipes.model.staticproperty.ColorPickerStaticProperty;
import org.apache.streampipes.model.staticproperty.DefaultStaticPropertyVisitor;
import org.apache.streampipes.model.staticproperty.FileStaticProperty;
@@ -66,6 +67,11 @@ public class CheckCompletedVisitor extends DefaultStaticPropertyVisitor {
validateNull(codeInputStaticProperty, codeInputStaticProperty.getValue());
}
+ @Override
+ public void visit(CollectionStaticProperty collectionStaticProperty) {
+ collectionStaticProperty.getMembers().forEach(sp -> sp.accept(this));
+ }
+
@Override
public void visit(ColorPickerStaticProperty colorPickerStaticProperty) {
validateNull(colorPickerStaticProperty, colorPickerStaticProperty.getSelectedColor());
@@ -206,7 +212,7 @@ public class CheckCompletedVisitor extends DefaultStaticPropertyVisitor {
validationInfos.add(
PipelineElementValidationInfo.error(
String.format(
- "Configuration option \"%s\" as no value although it is marked as required",
+ "Configuration option \"%s\" has no value although it is marked as required",
sp.getInternalName()
)
)