Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions src/data/helper/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,23 +431,7 @@ function applySingleDataTransform(
})
);

if (__DEV__) {
if (transOption.print) {
const printStrArr = map(resultList, extSource => {
const pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';
return [
'=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',
'- transform result data:',
makePrintable(extSource.data),
'- transform result dimensions:',
makePrintable(extSource.dimensions)
].join('\n');
}).join('\n');
log(printStrArr);
}
}

return map(resultList, function (result, resultIndex) {
const resultSourceList = map(resultList, function (result, resultIndex) {
let errMsg = '';

if (!isObject(result)) {
Expand Down Expand Up @@ -536,6 +520,24 @@ function applySingleDataTransform(
null
);
});

if (__DEV__) {
if (transOption.print) {
const printStrArr = map(resultSourceList, source => {
const pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';
return [
'=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',
'- transform result data:',
makePrintable(source.data),
'- transform result dimensions:',
makePrintable(map(source.dimensionsDefine, dimDef => dimDef.name))
].join('\n');
}).join('\n');
log(printStrArr);
}
}

return resultSourceList;
}

function isSupportedSourceFormat(sourceFormat: SourceFormat): boolean {
Expand Down
25 changes: 25 additions & 0 deletions test/ut/spec/data/dataTransform.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.