Skip to content

Commit

Permalink
fix(event-flow-viz): handle null metadata selection (#11885)
Browse files Browse the repository at this point in the history
* Initialize object with empty array if is multiselect, fix 500 BE error

* modify data coming
  • Loading branch information
maloun96 authored Dec 8, 2020
1 parent 8f1ac7e commit 05258eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ export default class SelectControl extends React.PureComponent {
// Beware: This is acting like an on-click instead of an on-change
// (firing every time user chooses vs firing only if a new option is chosen).
onChange(opt) {
let optionValue = null;
let optionValue = this.props.multi ? [] : null;
if (opt) {
if (this.props.multi) {
optionValue = [];
opt.forEach(o => {
// select all options
if (o.meta === true) {
Expand Down
2 changes: 1 addition & 1 deletion superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -2701,7 +2701,7 @@ def query_obj(self) -> QueryObjectDict:
entity_key = form_data["entity"]
meta_keys = [
col
for col in form_data["all_columns"]
for col in form_data["all_columns"] or []
if col != event_key and col != entity_key
]

Expand Down

0 comments on commit 05258eb

Please sign in to comment.