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

Issue with Dimension Specs #3908

Closed
3 tasks done
kkalyan opened this issue Nov 20, 2017 · 4 comments
Closed
3 tasks done

Issue with Dimension Specs #3908

kkalyan opened this issue Nov 20, 2017 · 4 comments

Comments

@kkalyan
Copy link
Contributor

kkalyan commented Nov 20, 2017

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.26.0 on Mac.
this is something that worked fine on 0.19.1

Expected results

Dimension Specs using lookup.

Actual results

Exception in the explore screen.

"None of [[u'replaceMissingValueWith', u'outputName', u'lookup', u'type', u'dimension']] are in the [index]"

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/superset/viz.py", line 275, in get_payload
    df = self.get_df()
  File "/usr/local/lib/python2.7/site-packages/superset/viz.py", line 98, in get_df
    self.results = self.datasource.query(query_obj)
  File "/usr/local/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 1069, in query
    client=client, query_obj=query_obj, phase=2)
  File "/usr/local/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 865, in get_query_str
    return self.run_query(client=client, phase=phase, **query_obj)
  File "/usr/local/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 1006, in run_query
    qry['dimensions'], filters)
  File "/usr/local/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 874, in _add_filter_from_pre_query_data
    f = Dimension(dim) == row[dim]
  File "/usr/local/lib/python2.7/site-packages/pandas/core/series.py", line 642, in __getitem__
    return self._get_with(key)
  File "/usr/local/lib/python2.7/site-packages/pandas/core/series.py", line 683, in _get_with
    return self.loc[key]
  File "/usr/local/lib/python2.7/site-packages/pandas/core/indexing.py", line 1328, in __getitem__
    return self._getitem_axis(key, axis=0)
  File "/usr/local/lib/python2.7/site-packages/pandas/core/indexing.py", line 1541, in _getitem_axis
    return self._getitem_iterable(key, axis=axis)
  File "/usr/local/lib/python2.7/site-packages/pandas/core/indexing.py", line 1081, in _getitem_iterable
    self._has_valid_type(key, axis)
  File "/usr/local/lib/python2.7/site-packages/pandas/core/indexing.py", line 1418, in _has_valid_type
    (key, self.obj._get_axis_name(axis)))
KeyError: "None of [[u'replaceMissingValueWith', u'outputName', u'lookup', u'type', u'dimension']] are in the [index]"

Steps to reproduce

Create a dimension Spec

for eg:

{ 
  "type":"lookup",
  "dimension":"device_type_id",
  "replaceMissingValueWith": "Unknown",
  "outputName":"device_type_id",
  "lookup":{"type": "map", "map":
  	{"1":"Desktop", "2": "Phone","3":"Tablet","4":"ConnectedTv"}
  	}
}

and run groupBy in the Explore view Table Visualization.

@ajreid21
Copy link

ajreid21 commented Nov 21, 2017

Does it work when you include an additional group by field? I noticed this as well, but it works when you include another group by field.

@kkalyan
Copy link
Contributor Author

kkalyan commented Nov 21, 2017

@ajreid21 yes, it works if there are multiple group-by dimensions.
bug introduced by #3796 cc @Mogball?

@Mogball
Copy link
Contributor

Mogball commented Nov 21, 2017

@kkalyan #3796 is the fix for this bug.

Superset 0.20.6 does not include #3796.

@kkalyan
Copy link
Contributor Author

kkalyan commented Nov 21, 2017

@Mogball bug is still there (with extraction dimension spec) on master. will send you the test link on slack :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants