Skip to content

Commit

Permalink
[bugfix] visualize flow error: 'Metric x is not valid'
Browse files Browse the repository at this point in the history
The metric name in the frontend doesn't match the one generated on the
backend. It turns out the explore view will default to the first
metric so specifying one isn't needed.
  • Loading branch information
mistercrunch committed Jul 26, 2017
1 parent 49ab091 commit eac0a40
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,13 @@ class VisualizeModal extends React.PureComponent {
this.props.actions.createDatasource(this.buildVizOptions(), this)
.done(() => {
const columns = Object.keys(this.state.columns).map(k => this.state.columns[k]);
const mainMetric = columns.filter(d => d.agg)[0];
const mainGroupBy = columns.filter(d => d.is_dim)[0];
const formData = {
datasource: this.props.datasource,
viz_type: this.state.chartType.value,
since: '100 years ago',
limit: '0',
};
if (mainMetric) {
formData.metrics = [mainMetric.name];
formData.metric = mainMetric.name;
}
if (mainGroupBy) {
formData.groupby = [mainGroupBy.name];
}
Expand Down

0 comments on commit eac0a40

Please sign in to comment.