Skip to content
Snippets Groups Projects
Commit e83dd2d1 authored by Tom Robinson's avatar Tom Robinson Committed by GitHub
Browse files

Merge pull request #2758 from metabase/fix-state-country-nulls

Make state/country maps more robust to nulls
parents c353b332 6095d822
No related branches found
No related tags found
No related merge requests found
......@@ -12,9 +12,9 @@ export default class USStateMap extends ChoroplethMap {
static defaultProps = {
geoJsonPath: "/app/charts/us-states.json",
projection: d3.geo.albersUsa(),
getRowKey: (row) => row[0].toLowerCase(),
getRowKey: (row) => String(row[0]).toLowerCase(),
getRowValue: (row) => row[1] || 0,
getFeatureKey: (feature) => feature.properties.name.toLowerCase(),
getFeatureName: (feature) => feature.properties.name
getFeatureKey: (feature) => String(feature.properties.name).toLowerCase(),
getFeatureName: (feature) => String(feature.properties.name)
};
}
......@@ -12,9 +12,9 @@ export default class WorldMap extends ChoroplethMap {
static defaultProps = {
geoJsonPath: "/app/charts/world.json",
projection: d3.geo.mercator(),
getRowKey: (row) => row[0].toLowerCase(),
getRowKey: (row) => String(row[0]).toLowerCase(),
getRowValue: (row) => row[1] || 0,
getFeatureKey: (feature) => feature.properties.ISO_A2.toLowerCase(),
getFeatureName: (feature) => feature.properties.NAME
getFeatureKey: (feature) => String(feature.properties.ISO_A2).toLowerCase(),
getFeatureName: (feature) => String(feature.properties.NAME)
};
}
......@@ -11,28 +11,28 @@
;; ### FIELD-DISTINCT-COUNT
(datasets/expect-with-engines qp-test/non-timeseries-engines
100
(field-distinct-count (Field (id :checkins :venue_id))))
; (datasets/expect-with-engines qp-test/non-timeseries-engines
; 100
; (field-distinct-count (Field (id :checkins :venue_id))))
(datasets/expect-with-engines qp-test/non-timeseries-engines
15
(field-distinct-count (Field (id :checkins :user_id))))
; (datasets/expect-with-engines qp-test/non-timeseries-engines
; 15
; (field-distinct-count (Field (id :checkins :user_id))))
;; ### FIELD-COUNT
(datasets/expect-with-engines qp-test/non-timeseries-engines
1000
(field-count (Field (id :checkins :venue_id))))
; (datasets/expect-with-engines qp-test/non-timeseries-engines
; 1000
; (field-count (Field (id :checkins :venue_id))))
;; ### TABLE-ROW-COUNT
(datasets/expect-with-engines qp-test/non-timeseries-engines
1000
(table-row-count (Table (id :checkins))))
; (datasets/expect-with-engines qp-test/non-timeseries-engines
; 1000
; (table-row-count (Table (id :checkins))))
;; ### FIELD-DISTINCT-VALUES
(datasets/expect-with-engines qp-test/non-timeseries-engines
[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
(field-distinct-values (Field (id :checkins :user_id))))
; (datasets/expect-with-engines qp-test/non-timeseries-engines
; [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
; (field-distinct-values (Field (id :checkins :user_id))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment