-
Notifications
You must be signed in to change notification settings - Fork 14k
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
feat: add renameOperator #19776
feat: add renameOperator #19776
Conversation
Codecov Report
@@ Coverage Diff @@
## master #19776 +/- ##
==========================================
- Coverage 66.51% 66.41% -0.10%
==========================================
Files 1690 1691 +1
Lines 64730 64748 +18
Branches 6656 6660 +4
==========================================
- Hits 43054 43003 -51
- Misses 19977 20046 +69
Partials 1699 1699
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
b486827
to
a4cbd74
Compare
for series in df.columns.to_flat_index(): | ||
_cells = [] | ||
for cell in series if is_sequence(series) else [series]: | ||
if pd.notnull(cell): |
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.
The top-level columns are might set to None
in the rename operator. Flatten skip the None
level.
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 and tested to work well. Thanks so much for working on this! I think we're starting to approach the limits of what we can do with the current post processing functionality. To be able to move some of this functionality into the column/metric controls we will probably have to design a new API for these operations to make sure we're future proofed for any future use cases.
(cherry picked from commit 3c28cd4)
SUMMARY
Before Dataframe
Before PR, in the timeseries charts, the result column names follow the simple rules that combine all the levels into a single string. For example, in the birth_name dataset, select 1)
ds
as x-axis, 2)sum_num
as metrics 3)gender
as dimensions 4)1990 : 2000
as time range 5)1 year ago
andactual values
in time comparison. The intermediate MulitiIndex dataframe is:then, the MultiIndex dataframe is changed plain dataframe by the
flatten operator
.The legacy NVD3 chart has a special rule that removes or renames columns. The rule will apply to columns if the chart has:
After the PR
So the PR introduces
rename operator
for this caseKnown limitations
difference
,percentage change
, andradio
in the time comparison.I will handle these cases in the future and provide customized rename on the UI.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After
TESTING INSTRUCTIONS
CI and before SUMMARY paragraph
ADDITIONAL INFORMATION