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

zehnder 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 073b26e2f9 fix(#3679): add support for data type changes in 
AdapterBuilder and related classes (#3680)
073b26e2f9 is described below

commit 073b26e2f93dfe04b8a5746f942d4f93625dc4da
Author: Philipp Zehnder <[email protected]>
AuthorDate: Tue Jun 17 12:22:28 2025 +0200

    fix(#3679): add support for data type changes in AdapterBuilder and related 
classes (#3680)
---
 ui/cypress/support/builder/AdapterBuilder.ts       | 12 ++++++++++
 ui/cypress/support/model/AdapterInput.ts           |  3 +++
 ui/cypress/support/model/DataExplorerWidget.ts     |  2 --
 ui/cypress/support/model/DataTypeString.ts         | 25 +++++++++++++++++++++
 ui/cypress/support/model/EventPropertyInput.ts     |  4 +++-
 ui/cypress/support/model/PropertyDataTypeChange.ts | 26 ++++++++++++++++++++++
 .../utils/connect/ConnectEventSchemaUtils.ts       | 17 +++++++++++++-
 ui/cypress/support/utils/connect/ConnectUtils.ts   |  4 ++++
 .../filterNumericalStringProperties.spec.ts        |  3 ++-
 9 files changed, 91 insertions(+), 5 deletions(-)

diff --git a/ui/cypress/support/builder/AdapterBuilder.ts 
b/ui/cypress/support/builder/AdapterBuilder.ts
index 1bf5d2257d..bba9e303bd 100644
--- a/ui/cypress/support/builder/AdapterBuilder.ts
+++ b/ui/cypress/support/builder/AdapterBuilder.ts
@@ -20,6 +20,8 @@ import { UserInput } from '../model/UserInput';
 import { UserInputType } from '../model/UserInputType';
 import { AdapterInput } from '../model/AdapterInput';
 import { TreeNodeUserInputBuilder } from './TreeNodeUserInputBuilder';
+import { DataTypeString } from '../model/DataTypeString';
+import { PropertyDataTypeChange } from '../model/PropertyDataTypeChange';
 
 export class AdapterBuilder {
     adapterInput: AdapterInput;
@@ -81,6 +83,16 @@ export class AdapterBuilder {
         return this;
     }
 
+    public addDataTypeChange(propertyName: string, newType: DataTypeString) {
+        const propertyDataTypeChange = new PropertyDataTypeChange();
+        propertyDataTypeChange.dataType = newType;
+        propertyDataTypeChange.propertyName = propertyName;
+
+        this.adapterInput.dataTypeChanges.push(propertyDataTypeChange);
+
+        return this;
+    }
+
     public setStartAdapter(startAdapter: boolean) {
         this.adapterInput.startAdapter = startAdapter;
         return this;
diff --git a/ui/cypress/support/model/AdapterInput.ts 
b/ui/cypress/support/model/AdapterInput.ts
index 0b3661d82f..0340758802 100644
--- a/ui/cypress/support/model/AdapterInput.ts
+++ b/ui/cypress/support/model/AdapterInput.ts
@@ -16,6 +16,7 @@
  *
  */
 
+import { PropertyDataTypeChange } from './PropertyDataTypeChange';
 import { UserInput } from './UserInput';
 
 export class AdapterInput {
@@ -32,4 +33,6 @@ export class AdapterInput {
     adapterConfiguration: UserInput[];
     format: string;
     formatConfiguration: UserInput[];
+
+    dataTypeChanges: PropertyDataTypeChange[] = [];
 }
diff --git a/ui/cypress/support/model/DataExplorerWidget.ts 
b/ui/cypress/support/model/DataExplorerWidget.ts
index 9d66c550df..da36a2c507 100644
--- a/ui/cypress/support/model/DataExplorerWidget.ts
+++ b/ui/cypress/support/model/DataExplorerWidget.ts
@@ -16,8 +16,6 @@
  *
  */
 
-import { TableConfig } from 
'../../../src/app/dashboard/components/widgets/table/table-config';
-
 export class DataExplorerWidget {
     public static TABLE = 'table';
     public static TIME_SERIES = 'time-series-chart';
diff --git a/ui/cypress/support/model/DataTypeString.ts 
b/ui/cypress/support/model/DataTypeString.ts
new file mode 100644
index 0000000000..aa5e3290da
--- /dev/null
+++ b/ui/cypress/support/model/DataTypeString.ts
@@ -0,0 +1,25 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+export type DataTypeString =
+    | 'String'
+    | 'Boolean'
+    | 'Double'
+    | 'Float'
+    | 'Integer'
+    | 'Long';
diff --git a/ui/cypress/support/model/EventPropertyInput.ts 
b/ui/cypress/support/model/EventPropertyInput.ts
index 8cd8303606..7cf6c7bf75 100644
--- a/ui/cypress/support/model/EventPropertyInput.ts
+++ b/ui/cypress/support/model/EventPropertyInput.ts
@@ -16,8 +16,10 @@
  *
  */
 
+import { DataTypeString } from './DataTypeString';
+
 export class EventPropertyInput {
     runtimeName: string;
-    runtimeType: 'String' | 'Boolean' | 'Integer' | 'Long' | 'Double' | 
'Float';
+    runtimeType: DataTypeString;
     semanticType = '';
 }
diff --git a/ui/cypress/support/model/PropertyDataTypeChange.ts 
b/ui/cypress/support/model/PropertyDataTypeChange.ts
new file mode 100644
index 0000000000..3da867d2a3
--- /dev/null
+++ b/ui/cypress/support/model/PropertyDataTypeChange.ts
@@ -0,0 +1,26 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+import { DataTypeString } from './DataTypeString';
+
+export class PropertyDataTypeChange {
+    // The name of the property whose data type should be changed
+    propertyName: string;
+    // The value of the new data type
+    dataType: DataTypeString;
+}
diff --git a/ui/cypress/support/utils/connect/ConnectEventSchemaUtils.ts 
b/ui/cypress/support/utils/connect/ConnectEventSchemaUtils.ts
index b47213e93e..4bb6de504a 100644
--- a/ui/cypress/support/utils/connect/ConnectEventSchemaUtils.ts
+++ b/ui/cypress/support/utils/connect/ConnectEventSchemaUtils.ts
@@ -17,6 +17,8 @@
  */
 
 import { ConnectBtns } from './ConnectBtns';
+import { DataTypeString } from '../../model/DataTypeString';
+import { PropertyDataTypeChange } from '../../model/PropertyDataTypeChange';
 
 export class ConnectEventSchemaUtils {
     public static markPropertyAsMeasurement(propertyName: string) {
@@ -222,9 +224,22 @@ export class ConnectEventSchemaUtils {
         }).click({ force: true });
     }
 
+    public static changePropertyDataTypes(
+        dataTypeChanges: PropertyDataTypeChange[],
+    ) {
+        if (dataTypeChanges.length > 0) {
+            dataTypeChanges.forEach(dataTypeChange => {
+                ConnectEventSchemaUtils.changePropertyDataType(
+                    dataTypeChange.propertyName,
+                    dataTypeChange.dataType,
+                );
+            });
+        }
+    }
+
     public static changePropertyDataType(
         propertyName: string,
-        dataType: string,
+        dataType: DataTypeString,
         warningIsShown: boolean = false,
     ) {
         ConnectEventSchemaUtils.clickEditProperty(propertyName);
diff --git a/ui/cypress/support/utils/connect/ConnectUtils.ts 
b/ui/cypress/support/utils/connect/ConnectUtils.ts
index 7b04699455..6c74bb65fe 100644
--- a/ui/cypress/support/utils/connect/ConnectUtils.ts
+++ b/ui/cypress/support/utils/connect/ConnectUtils.ts
@@ -48,6 +48,10 @@ export class ConnectUtils {
             ConnectEventSchemaUtils.addTimestampProperty();
         }
 
+        ConnectEventSchemaUtils.changePropertyDataTypes(
+            adapterConfiguration.dataTypeChanges,
+        );
+
         ConnectUtils.configureDimensionProperties(adapterConfiguration);
 
         ConnectEventSchemaUtils.finishEventSchemaConfiguration();
diff --git a/ui/cypress/tests/datalake/filterNumericalStringProperties.spec.ts 
b/ui/cypress/tests/datalake/filterNumericalStringProperties.spec.ts
index 3a699d348d..40b179a5f3 100644
--- a/ui/cypress/tests/datalake/filterNumericalStringProperties.spec.ts
+++ b/ui/cypress/tests/datalake/filterNumericalStringProperties.spec.ts
@@ -35,6 +35,7 @@ describe('Validate that filter works for numerical dimension 
property', () => {
         const adapterInput = AdapterBuilder.create('File_Stream')
             .setName('Test Adapter')
             .setTimestampProperty('timestamp')
+            .addDataTypeChange('dimensionKey', 'Integer')
             .addDimensionProperty('dimensionKey')
             .setStoreInDataLake()
             .setFormat('csv')
@@ -64,7 +65,7 @@ describe('Validate that filter works for numerical dimension 
property', () => {
 
         // select filter for tag
         DataLakeUtils.selectDataConfig();
-        var filterConfig = new DataLakeFilterConfig('dimensionKey', '1.0', 
'=');
+        var filterConfig = new DataLakeFilterConfig('dimensionKey', '1', '=');
         DataLakeUtils.dataConfigAddFilter(filterConfig);
 
         // validate data in table is filtered

Reply via email to