diff --git a/frontend/src/metabase/visualizations/components/ChoroplethMap.jsx b/frontend/src/metabase/visualizations/components/ChoroplethMap.jsx index bcf2f12ad9bfbbee4f05aa4c4eaf18c6914e7724..30546f2e23871635e58153712c624567bb35ab8a 100644 --- a/frontend/src/metabase/visualizations/components/ChoroplethMap.jsx +++ b/frontend/src/metabase/visualizations/components/ChoroplethMap.jsx @@ -1,10 +1,9 @@ -/* eslint-disable no-color-literals */ /* eslint-disable react/prop-types */ import React, { Component } from "react"; import { t } from "ttag"; import LoadingSpinner from "metabase/components/LoadingSpinner"; -import { isString } from "metabase/lib/schema_metadata"; +import { isMetric, isString } from "metabase/lib/schema_metadata"; import { MinColumnsError } from "metabase/visualizations/lib/errors"; import MetabaseSettings from "metabase/lib/settings"; @@ -104,8 +103,8 @@ export default class ChoroplethMap extends Component { static minSize = { width: 4, height: 4 }; - static isSensible({ cols, rows }) { - return cols.length > 1 && isString(cols[0]); + static isSensible({ cols }) { + return cols.filter(isString).length > 0 && cols.filter(isMetric).length > 0; } static checkRenderable([ diff --git a/frontend/test/metabase/scenarios/visualizations/maps.cy.spec.js b/frontend/test/metabase/scenarios/visualizations/maps.cy.spec.js index c92102f25d2106298481d4cd201a0a267138af2c..06bad72c1aee0cb6b6d3067e6b10205f63635573 100644 --- a/frontend/test/metabase/scenarios/visualizations/maps.cy.spec.js +++ b/frontend/test/metabase/scenarios/visualizations/maps.cy.spec.js @@ -55,7 +55,7 @@ describe("scenarios > visualizations > maps", () => { cy.get(".leaflet-container"); }); - it.skip("should suggest map visualization regardless of the first column type (metabase#14254)", () => { + it("should suggest map visualization regardless of the first column type (metabase#14254)", () => { cy.createNativeQuestion({ name: "14254", native: {