-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Mapbox Visualizatuion error cause by "is not JSON serializable" #3604
Comments
Please reproduce with latest version and also post the full backtrace proberly quoted in text and not in picture. |
This is full backtrace i receveid
|
Quote with 3 backticks please. And newlines. |
|
It's ok?? |
No. Copy it from the server logs, it'll have the proper newlines. |
|
This is log directly receivred from server. |
I'm experiencing the same issue |
Same here. Would be great if this worked as there are many Geo coded (Lat Long) data set use cases for interactive exploration. As an aside, would something like Leaflet.js be possible with Superset? |
DruidMetric probably needs a |
I also have the same issue. How can we set this default method? |
Digging abit deeper, unfortunately adding a "default()" method will not work. The json module has a bit of a peculiar default way of doing serialization, which does not allow serialization methods being added to classes. However, here it seems that a DruidMetric is somewhere to being forgotten to be .json_obj() as it is done in |
Ok I found the issue. The dimensions of the LimitSpec part of the query are populated with metrics or self.metrics. This is a druidmetric instead of a column name. I think the logic (run_query) is wrong here and it should use dimensions instead and not metrics. I’m not entirely sure and need some help from @Fokko or @mistercrunch. Then the PR is quite simple. Offending lines: |
in case a form did not specify a metric (e.g. mapbox). If it is not available it now defaults to the first dimension instead. This fixes issue apache#3604
A few tangents here: It's been tricky to manage how aggregations work for geospatial, in many cases users do not want to aggregate and just use atomic data. In other cases people want to aggregate data. There's also the fact that with WebGL / Deck.GL we can actually afford to visualize hundreds of thousands of data points, and aggregation as necessary technically. The way the new Deck.GL visualizations work is that they don't aggregate unless you specify a metric. I'm unclear on how to handle this original mapbox visualization in the light of the recent work we've been doing using Deck.GL. The new scatterplot viz is much better than this one, but it doesn't support the dynamic clustering use case (where clusters are created on the fly as users zoom in /out). We may want to refactor that visualization to be more like the new ones. First thing to do would be to use the |
@mistercrunch the fix I made is a bug fix in the spec of run_query. It should not be able to pass a DruidMetric directly to the json passed to Druid. MapBox just exposes it but it could occur in different circumstances as well. In other words, the pr fixes this issue by fixing a fundamental bug. Ptal |
@bolkedebruin gotcha, let me review the PR. I just needed to gather some thoughts around what we're going to do with the Mapbox viz and used this PR as a vehicle. |
Cheers. No prob |
in case a form did not specify a metric (e.g. mapbox). If it is not available it now defaults to the first dimension instead. This fixes issue #3604
@amoussoubaruch This issue can be closed, it has been fixed |
Hi, i am facing the same issue.On running single custom dimension i get the following error: Can you specify which version of druid to use? and what is the fix? |
I don't think it really has to do with Druid. Which version Superset are you running? |
Hi,
Using 0.20.
Two issues am facing:
1.Extensions are non filterable.
2.And single extension dimension is non groupable.It throws the error
specified in the above post.
Any reason why topN query doesnt work on superset for single extension
dimension? Same works if i hit the same query on druid.
…On Thu, Feb 1, 2018 at 5:38 PM, Fokko Driesprong ***@***.***> wrote:
I don't think it really has to do with Druid. Which version Superset are
you running?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3604 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AZHoWqyDkzi6N-Yeb5Bh7FMovUCpRVMKks5tQakvgaJpZM4Pu95g>
.
|
@chirpy2291 the fix is new (not even in a released version afaik) and you are running an old version of superset. So why not use master first and then open a new issue if needed instead of hijacking this closed issue? |
Since the code is in production its not possible to include all the new
features and release with the given timeframe. So sometimes when we have
to go forward in a short span of time we have to look back a little. I
thought you being a contributor would be able to help. Sorry for the
inconvenience.
…On Sun, 4 Feb 2018 at 4:58 PM, bolkedebruin ***@***.***> wrote:
@chirpy2291 <https://github.com/chirpy2291> the fix is new (not even in a
released version afaik) and you are running an old version of superset. So
why not use master first and then open a new issue if needed instead of
hijacking this closed issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3604 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AZHoWq69ltZgguDB66Wp2znrgmjhDRdpks5tRZRMgaJpZM4Pu95g>
.
|
in case a form did not specify a metric (e.g. mapbox). If it is not available it now defaults to the first dimension instead. This fixes issue apache#3604
in case a form did not specify a metric (e.g. mapbox). If it is not available it now defaults to the first dimension instead. This fixes issue apache#3604
Make sure these boxes are checked before submitting your issue - thank you!
Superset version
0.19.1
Expected results
I try to draw mapbox in superset. I have dataset with column Latitude and Longitude and use it in respective field.
Actual results
TypeError: <superset.connectors.druid.models.DruidMetric object at 0xefbea90> is not JSON serializable
Steps to reproduce
Anyone already have the same problem?
Thanks
The text was updated successfully, but these errors were encountered: