Skip to content

Commit

Permalink
isRemoteCalculationSupported: remove backwards compatbility check for…
Browse files Browse the repository at this point in the history
… spatial indices (#917)
  • Loading branch information
zbigg authored Oct 2, 2024
1 parent 35e161a commit 40ea30a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Not released

- isRemoteCalculationSupported: remove backwards compatbility check for spatial indices [#917](https://github.com/CartoDB/carto-react/pull/917)

## 3.0.0

### 3.0.0-alpha.22 (2024-09-30)
Expand Down
12 changes: 11 additions & 1 deletion packages/react-widgets/__tests__/models/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,22 @@ describe('utils', () => {
['v3', { ...V3_SOURCE, type: 'tileset' }, false],
['v3/databricks', { ...V3_SOURCE, provider: 'databricks' }, false],
['v3/databricksRest', { ...V3_SOURCE, provider: 'databricksRest' }, true],
['v3/h3/no dataResolution', { ...V3_SOURCE, geoColumn: 'h3' }, false],

[
'v3/h3/with dataResolution',
{ ...V3_SOURCE, geoColumn: 'h3', dataResolution: 5 },
true
],
[
'v3/h3-frompoint/without dataResolution',
{ ...V3_SOURCE, geoColumn: 'h3:geom', spatialDataType: 'geo' },
true
],
[
'v3/quadbin-frompoint/without dataResolution',
{ ...V3_SOURCE, geoColumn: 'quadbin:geom', spatialDataType: 'geo' },
true
],
[
'v3/quadbin/with dataResolution',
{ ...V3_SOURCE, geoColumn: 'quadbin:abc', spatialFiltersResolution: 5 },
Expand Down
10 changes: 0 additions & 10 deletions packages/react-widgets/src/models/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
AggregationTypes,
getSpatialIndexFromGeoColumn,
_filtersToSQL,
Provider
} from '@carto/react-core';
Expand All @@ -21,15 +20,6 @@ export function isRemoteCalculationSupported(props) {
return false;
}

const isDynamicSpatialIndex =
source.geoColumn && getSpatialIndexFromGeoColumn(source.geoColumn);
if (
isDynamicSpatialIndex &&
!source.dataResolution &&
!source.spatialFiltersResolution
) {
return false;
}
return true;
}

Expand Down

0 comments on commit 40ea30a

Please sign in to comment.