-
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
fix: chart keys in MultiLineViz #12937
Conversation
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.
A minor suggestion, let me know what you think
superset/viz.py
Outdated
@@ -1453,10 +1453,10 @@ def get_data(self, df: pd.DataFrame) -> VizData: | |||
x_values = [value["x"] for value in series["values"]] | |||
min_x = min(x_values + ([min_x] if min_x is not None else [])) | |||
max_x = max(x_values + ([max_x] if max_x is not None else [])) | |||
|
|||
series_keys = series["key"] if isinstance(series["key"], (list, tuple)) else [series["key"]] |
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.
looks like they come in as tuple
or list
or str
(looking at viz_type="line"
) and defaults to an empty list if empty list
or tuple
or empty str
on line 1451.
I don't want to change much as I'm not very familiar with the codebase yet so sorry this is minimal effort. Hopefully, at some point, I can come back and help maintain this
Codecov Report
@@ Coverage Diff @@
## master #12937 +/- ##
==========================================
+ Coverage 68.98% 69.14% +0.16%
==========================================
Files 1025 494 -531
Lines 48767 32606 -16161
Branches 5241 0 -5241
==========================================
- Hits 33641 22547 -11094
+ Misses 14989 10059 -4930
+ Partials 137 0 -137
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
sorry - was making this into a single commit |
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.
LGTM, sorry for dropping the ball on this one!
SUMMARY
fixing multi-line viz issue of incorrectly formatted text for chart key when single line chart is used as a data
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
After
TEST PLAN
Observe correctly formatted key for data in API call for both multi-line charts and single-line charts as a chart source
ADDITIONAL INFORMATION