-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix(event-flow-viz): handle null metadata selection #11885
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11885 +/- ##
===========================================
- Coverage 67.12% 54.88% -12.25%
===========================================
Files 915 421 -494
Lines 44537 14809 -29728
Branches 4235 3822 -413
===========================================
- Hits 29897 8128 -21769
+ Misses 14526 6681 -7845
+ Partials 114 0 -114
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be simpler to make the backend more resilient to nulls by changing the below, something like for col in form_data["all_columns"] or []
:
https://github.com/apache/incubator-superset/blob/07288789e2adce50939eeb564b1771120bfbc11d/superset/viz.py#L2701
Thanks for the quick fix! unrelated to this PR @rusackas can we change metadata back to additional metadata? |
Already done. |
I agree with @rusackas , better to make both ends more resilient. |
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing - I might be missing something here, but I don't quite get why this can't always be initialized to []
. @maloun96 can you check if that works? I'd much rather not have a ternary here that can be avoided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@villebro in case that select has only 1 value it should be initialized with null, only if it can have multiple select that it should be []
SUMMARY
Fix issue when removing additional metadata from the event flow chart. This was caused by the server that returns 500.
To fix that we need to send an empty array instead of null for multiselects.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
After
TEST PLAN
ADDITIONAL INFORMATION