apache/superset · error · Error
Unknown input format
Error message
Unknown input format
What it means
Thrown by PivotData.forEachRecord in the pivot-table plugin's vendored react-pivottable utilities. Upstream pivottable accepts arrays, functions, or jQuery selections of tables as input, but this trimmed port only handles arrays of record objects; anything else is rejected before any record is processed. It is a fail-fast guard against an input contract violation, not a data problem.
Source
Thrown at superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:1368
},
format() {
return '';
},
}
);
}
}
// can handle arrays or jQuery selections of tables
PivotData.forEachRecord = function (
input: unknown,
processRecord: (record: PivotRecord) => void,
) {
if (Array.isArray(input)) {
// array of objects
return input.map(record => processRecord(record));
}
throw new Error(t('Unknown input format'));
};
PivotData.defaultProps = {
cols: [],
rows: [],
vals: [],
sorters: {},
rowOrder: 'key_a_to_z',
colOrder: 'key_a_to_z',
};
PivotData.propTypes = {
data: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.func])
.isRequired,
cols: PropTypes.arrayOf(PropTypes.string),
rows: PropTypes.arrayOf(PropTypes.string),
vals: PropTypes.arrayOf(PropTypes.string),
valueFilter: PropTypes.objectOf(PropTypes.objectOf(PropTypes.bool)),View on GitHub (pinned to f4587218dd)
Solutions
- Convert your input to a plain array of record objects before passing it: Array.from(input) or [...input] for iterables; call the function yourself if input is a records-producing callback.
- If you wrapped PivotData, verify the data argument reaches it unmodified (not a DOM/jQuery selection or undefined after an async fetch race).
- Extend forEachRecord in your fork with the additional branches (function input, jQuery table) copied from upstream react-pivottable if you need them.
Example fix
// before PivotData.forEachRecord(recordsIterable, processRecord); // throws // after PivotData.forEachRecord([...recordsIterable], processRecord);
Defensive patterns
Strategy: type-guard
Validate before calling
if (!Array.isArray(input)) {
input = Array.isArray(input?.records) ? input.records : Array.from(input);
}
PivotData.forEachRecord(input, processRecord); Type guard
const isRecordArray = (v: unknown): v is PivotRecord[] => Array.isArray(v) && v.every(r => r != null && typeof r === 'object');
Try / catch
try { PivotData.forEachRecord(data, cb); } catch (e) { if (e instanceof Error && e.message.includes('Unknown input format')) throw new TypeError('PivotData input must be an array of records'); throw e; } Prevention
- Always materialize data to a plain array before feeding PivotData
- Do not port upstream jQuery/function input code paths against this vendored version
When it happens
Trigger: Calling PivotData.forEachRecord (directly or indirectly via PivotData construction / chart transformProps) with input that is not an Array — e.g. a generator, an iterable, a function returning records, a jQuery/DOM selection, or undefined/null data passed as the records argument.
Common situations: Custom forks or plugins that feed the pivot table with a non-array data source; upstream pivottable code copied over that passes a function; a data connector that returns a Map/stream instead of a plain array; tests that pass malformed query results.
AI-assisted analysis of apache/superset@f4587218dd (2026-08-14).
Data as JSON: /api/errors/5140a22eff621afb.
Report an issue: GitHub.