Skip to content

Commit d707835

Browse files
authored
fix handling of null values in arrow vectors (#2195)
* closes #2194
1 parent 6a0aa7e commit d707835

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/options.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,12 @@ function maybeTypedArrowify(vector, type) {
6868
return vector == null
6969
? vector
7070
: (type === undefined || type === Array) && isArrowDateType(vector.type)
71-
? coerceDates(vector.toArray())
72-
: maybeTypedArrayify(vector.toArray(), type);
71+
? coerceDates(vectorToArray(vector))
72+
: maybeTypedArrayify(vectorToArray(vector), type);
73+
}
74+
75+
function vectorToArray(vector) {
76+
return vector.nullCount ? vector.toJSON() : vector.toArray();
7377
}
7478

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

0 commit comments

Comments
 (0)