Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map does not work with custom SQL query #9346

Closed
Tobi28 opened this issue Jan 30, 2019 · 11 comments
Closed

Map does not work with custom SQL query #9346

Tobi28 opened this issue Jan 30, 2019 · 11 comments
Labels
Priority:P2 Average run of the mill bug Querying/Native The SQL/native query editor Type:Bug Product defects Visualization/

Comments

@Tobi28
Copy link

Tobi28 commented Jan 30, 2019

Hi,

as soon as I try to use an own SQL query to be shown in a map, a javascript error occurs and nothing can be done anymore. I tried it with different browsers: Chrome (71), Firefox (, Edge.
Operating System: Windows 10
Official docker image used as installation (version: 0.31.2)

It is easy to reproduce:

  • Take table People from the Sample Dataset
  • Select map
  • Map is opened and that works
  • Now modify it to an SQL query
  • After that, the map is not shown any more and the settings cannot be adjusted. Javascript error is thrown:
    `app-main.bundle.js?78262faa1c529a733077:5 Uncaught TypeError: Cannot read property 'map' of undefined
    at t.value (app-main.bundle.js?78262faa1c529a733077:5)
    at u._renderValidatedComponentWithoutOwnerOrContext (vendor.bundle.js?78262faa1c529a733077:145)
    at u._renderValidatedComponent (vendor.bundle.js?78262faa1c529a733077:145)
    at u.performInitialMount (vendor.bundle.js?78262faa1c529a733077:145)
    at u.mountComponent (vendor.bundle.js?78262faa1c529a733077:145)
    at Object.mountComponent (vendor.bundle.js?78262faa1c529a733077:83)
    at J.mountChildren (vendor.bundle.js?78262faa1c529a733077:145)
    at J._createInitialChildren (vendor.bundle.js?78262faa1c529a733077:145)
    at J.mountComponent (vendor.bundle.js?78262faa1c529a733077:145)
    at Object.mountComponent (vendor.bundle.js?78262faa1c529a733077:83)'

Thank you,
Tobias

@flamber
Copy link
Contributor

flamber commented Jan 30, 2019

@Tobi28
Reproduce steps: Create a question using QB with Sample Dataset:

  • Using People, group by Name+Longitude(no-bin)+Latitude(no-bin) and Limit 100
  • Get Answer, then choose Visualization Map
  • "Convert this question to SQL", still displaying the map until click "Get Answer"
  • Then it just displays: "Please select a region map."
    • Click "Edit Settings", errors with: TypeError: Cannot read property 'map' of undefined
    • Try instead clicking Visualization ⚙️ , then settings modal opens fine
Uncaught TypeError: Cannot read property 'map' of undefined
    at ChartSettings.render (ChartSettings.jsx:191)
    at ChartSettings.<anonymous> (makeAssimilatePrototype.js:15)
    at ReactCompositeComponent.js:793
    at measureLifeCyclePerf (ReactCompositeComponent.js:73)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (ReactCompositeComponent.js:792)
    at ReactCompositeComponentWrapper._renderValidatedComponent (ReactCompositeComponent.js:819)
    at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js:359)
    at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js:255)
    at Object.mountComponent (ReactReconciler.js:43)
    at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js:368)

@Tobi28
Copy link
Author

Tobi28 commented Jan 31, 2019

Hi,
thank you, that works! Strange, I tried exactly this a few days ago and had also some problems with that approach... But I cannot reproduce it any more.

@Tobi28
Copy link
Author

Tobi28 commented Jan 31, 2019

I have a similar problem now with the grid map. I autopin latitude and longitude from People in the sample data set. The grid map is shown perfectly.
But when I convert it to sql, the grid map cannot be configured properly (it says that it needs classified longitudes/latitudes). Although this is the automatically created query, that I used before. Thanks!

@flamber
Copy link
Contributor

flamber commented Jan 31, 2019

Great. The "Grid map requires binned longitude/latitude." problem in SQL is existing issue #8362

@flamber
Copy link
Contributor

flamber commented Apr 10, 2019

@salsakran This issue is still valid in 0.32.4 - updated my previous comment to make it more clear

@camsaul camsaul reopened this Apr 10, 2019
@benoror
Copy link

benoror commented Apr 15, 2019

Getting the same bug with any kind of question, custom and native query

@flamber
Copy link
Contributor

flamber commented Apr 15, 2019

@benoror If you're getting the same error, how do you reproduce it with Custom Question?

@calfzhou
Copy link

Just upgraded to Metabase 0.32.5.0, the same issue, for any question.

@flamber's method works, "click the gear icon near 'Visulation'". +1

@ribeirojose
Copy link

Also getting the same bug. Tried replacing country names with ISO 3166-1 alpha-2 codes, but this is ineffective. The Edit Settings button changes on hover, but is disabled.

@tonyisblind
Copy link

Hi has there been a solution for this yet? Thanks!

@flamber
Copy link
Contributor

flamber commented May 25, 2020

I cannot reproduce on 0.35.3 - think it was fixed in 0.32.9 or 0.33.0 with the new UI.

@flamber flamber closed this as completed May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:P2 Average run of the mill bug Querying/Native The SQL/native query editor Type:Bug Product defects Visualization/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants