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 12:59:54 UTC

(streampipes) branch fix-completeness-validation created (now cb3e295e82)

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a change to branch fix-completeness-validation
in repository https://gitbox.apache.org/repos/asf/streampipes.git


      at cb3e295e82 fix: Fix pipeline element validation for collections

This branch includes the following new commits:

     new cb3e295e82 fix: Fix pipeline element validation for collections

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(streampipes) 01/01: fix: Fix pipeline element validation for collections

Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch fix-completeness-validation
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit cb3e295e82ffd2985966b5c79468ccc291f112ea
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Tue Nov 19 13:59:35 2024 +0100

    fix: Fix pipeline element validation for collections
---
 .../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()
             )
         )