Skip to content

Commit

Permalink
closes #2194
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil committed Oct 10, 2024
1 parent 93f010b commit c7b17b6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,17 @@ function maybeTypedArrowify(vector, type) {
return vector == null
? vector
: (type === undefined || type === Array) && isArrowDateType(vector.type)
? coerceDates(vector.toArray())
: maybeTypedArrayify(vector.toArray(), type);
? coerceDates(vectorToArray(vector))
: maybeTypedArrayify(vectorToArray(vector), type);
}

function vectorToArray(vector) {
const values = vector.toArray();
if (values.nullCount) {
const NULL = vector.type?.typeId === 5 /* Utf8 */ ? null : undefined;
for (let i = 0; i < values.length; ++i) if (!values.isValid(i)) values[i] = NULL;
}
return values;
}

export const singleton = [null]; // for data-less decoration marks, e.g. frame
Expand Down

0 comments on commit c7b17b6

Please sign in to comment.