fix(Summarize Node): Fix spaces in Fields to Split By values converted to underscores (#15020)

This commit is contained in:
Shireen Missi
2025-04-30 16:24:31 +01:00
committed by GitHub
parent 7dca5295e1
commit 154153d86f
3 changed files with 214 additions and 7 deletions

View File

@@ -225,22 +225,22 @@ export function aggregateAndSplitData({
const groupedItems = new Map<unknown, IDataObject[]>();
for (const item of inputItems) {
let key = getValue(item, firstSplitKey);
let splitValue = getValue(item, firstSplitKey);
if (key && typeof key === 'object') {
key = JSON.stringify(key);
if (splitValue && typeof splitValue === 'object') {
splitValue = JSON.stringify(splitValue);
}
if (convertKeysToString) {
key = normalizeFieldName(String(key));
splitValue = String(splitValue);
}
if (options.skipEmptySplitFields && typeof key !== 'number' && !key) {
if (options.skipEmptySplitFields && typeof splitValue !== 'number' && !splitValue) {
continue;
}
const group = groupedItems.get(key) ?? [];
groupedItems.set(key, group.concat([item]));
const group = groupedItems.get(splitValue) ?? [];
groupedItems.set(splitValue, group.concat([item]));
}
const splits = new Map(