DataFrame: more thorough detection of unsorted values (#51602)

This commit is contained in:
Leon Sorokin authored and GitHub committed 2022-06-29 18:08:42 -05:00
1 parent 739d3469bc
commit 3bd2bdcebb
3 files changed
+46 -23

No files matched your search

@@ -294,5 +294,19 @@ describe('align frames', () => {
expect(isLikelyAscendingVector(new ArrayVector([7, 6, null]))).toBeFalsy();
expect(isLikelyAscendingVector(new ArrayVector([7, 8, 6]))).toBeFalsy();
});
it('ascending first/last', () => {
expect(isLikelyAscendingVector(new ArrayVector([10, 20, 30, 5, 15, 7, 43, 29, 11]), 3)).toBeFalsy();
expect(
isLikelyAscendingVector(new ArrayVector([null, 10, 20, 30, 5, null, 15, 7, 43, 29, 11, null]), 3)
).toBeFalsy();
});
it('null stuffs', () => {
expect(isLikelyAscendingVector(new ArrayVector([null, null, 1]), 3)).toBeTruthy();
expect(isLikelyAscendingVector(new ArrayVector([1, null, null]), 3)).toBeTruthy();
expect(isLikelyAscendingVector(new ArrayVector([null, null, null]), 3)).toBeTruthy();
expect(isLikelyAscendingVector(new ArrayVector([null, 1, null]), 3)).toBeTruthy();
});
});
});