Skip to content

Commit

Permalink
add test for Series.toTypedArray null handling
Browse files Browse the repository at this point in the history
  • Loading branch information
controversial committed Apr 24, 2024
1 parent 6b46542 commit ed47f11
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions __tests__/series.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,12 @@ describe("series", () => {
const actual = s.round({ decimals: 2 });
expect(actual).toSeriesEqual(expected);
});
test("toTypedArray handles nulls", () => {
const s = pl.Series('ints and nulls', [1, 2, 3, null, 5], pl.UInt8);
expect(() => s.toTypedArray()).toThrow();
expect(() => s.dropNulls().toTypedArray()).not.toThrow();
expect(s.dropNulls().toTypedArray()).toStrictEqual(new Uint8Array([1, 2, 3, 5]));
})
});
describe("comparators & math", () => {
test("add/plus", () => {
Expand Down

0 comments on commit ed47f11

Please sign in to comment.