• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

keplergl / kepler.gl / 19768106976

28 Nov 2025 03:32PM UTC coverage: 61.675% (-0.09%) from 61.76%
19768106976

push

github

web-flow
chore: patch release 3.2.3 (#3250)

* draft

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>

* patch

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>

* fix eslint during release

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>

---------

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>

6352 of 12229 branches covered (51.94%)

Branch coverage included in aggregate %.

13043 of 19218 relevant lines covered (67.87%)

81.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/deckgl-arrow-layers/src/utils/validate.ts
1
// SPDX-License-Identifier: MIT
2
// Copyright contributors to the kepler.gl project
3

4
// deck.gl-community
5
// SPDX-License-Identifier: MIT
6
// Copyright (c) vis.gl contributors
7

8
import {assert} from '@deck.gl/core/typed';
9
import {isArrowVector} from '@kepler.gl/utils';
10
import * as arrow from 'apache-arrow';
11

12
export function validateAccessors(props: Record<string, any>, table: arrow.Table): void {
13
  const vectorAccessors: arrow.Vector[] = [];
×
14
  const colorVectorAccessors: arrow.Vector[] = [];
×
15
  for (const [accessorName, accessorValue] of Object.entries(props)) {
×
16
    // Is it an accessor
17
    if (accessorName.startsWith('get')) {
×
18
      // Is it a vector accessor
19
      if (isArrowVector(accessorValue)) {
×
20
        vectorAccessors.push(accessorValue);
×
21

22
        // Is it a color vector accessor
23
        if (accessorName.endsWith('Color')) {
×
24
          colorVectorAccessors.push(accessorValue);
×
25
        }
26
      }
27
    }
28
  }
29

30
  validateVectorAccessors(table, vectorAccessors);
×
31
  for (const colorVectorAccessor of colorVectorAccessors) {
×
32
    validateColorVector(colorVectorAccessor);
×
33
  }
34
}
35

36
/**
37
 * Provide validation for accessors provided
38
 *
39
 * - Assert that all vectors have the same number of chunks as the main table
40
 * - Assert that all chunks in each vector have the same number of rows as the
41
 *   relevant batch in the main table.
42
 *
43
 */
44
export function validateVectorAccessors(table: arrow.Table, vectorAccessors: arrow.Vector[]) {
45
  // Check the same number of chunks as the table's batches
46
  for (const vectorAccessor of vectorAccessors) {
×
47
    assert(table.batches.length === vectorAccessor.data.length);
×
48
  }
49

50
  // Check that each table batch/vector data has the same number of rows
51
  for (const vectorAccessor of vectorAccessors) {
×
52
    for (let i = 0; i < table.batches.length; i++) {
×
53
      assert(table.batches[i].numRows === vectorAccessor.data[i].length);
×
54
    }
55
  }
56
}
57

58
export function validateColorVector(vector: arrow.Vector) {
59
  // Assert the color vector is a FixedSizeList
60
  assert(arrow.DataType.isFixedSizeList(vector.type));
×
61

62
  // Assert it has 3 or 4 values
63
  assert(vector.type.listSize === 3 || vector.type.listSize === 4);
×
64

65
  // Assert the child type is an integer
66
  assert(arrow.DataType.isInt(vector.type.children[0]));
×
67

68
  // Assert the child type is a Uint8
69
  // Property 'type' does not exist on type 'Int_<Ints>'. Did you mean 'TType'?
70
  assert(vector.type.children[0].type.bitWidth === 8);
×
71
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc