Skip to content
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

[Bugfix]: Fixing bug in label generation for multiple groupbys #3594

Merged
merged 1 commit into from
Oct 4, 2017

Conversation

fabianmenges
Copy link
Contributor

Fixes: #3590
Relates to: #3504 #3563 #3566

I guess I started this so I'll take 99% of the blame here:

History:

  1. Feature: Display the verbose name for metrics within Timeseries charts and legend. #3504 caused a bug where the metric names would be displayed in the legend even when there was only one metric.
  2. [nvd3] fix single metric showing up in legend #3563 fixed that bug, but caused label for first group by clause in time series - bar chart is always undefined  #3590 where the legend for multiple group by s does not get generated correctly
  3. [Fix]: Label generation for grouped by, single metric time series charts #3566 would have fixed both issues but came too late

So we either apply this fix or roll back #3563 and apply #3566

Hopefully this is the last issue :(

@coveralls
Copy link

coveralls commented Oct 4, 2017

Coverage Status

Coverage remained the same at 70.145% when pulling 9667507 on tc-dc:fmenges/label_fix into 04ea3ad on apache:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.145% when pulling 9667507 on tc-dc:fmenges/label_fix into 04ea3ad on apache:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.145% when pulling 9667507 on tc-dc:fmenges/label_fix into 04ea3ad on apache:master.

@fabianmenges fabianmenges changed the title [Bugfix]: Fxing bug in label generation for multiple groupbys [Bugfix]: Fixing bug in label generation for multiple groupbys Oct 4, 2017
} else {
label = verbose_map[column];
if (Array.isArray(column) && column.length) {
label = verbose_map[column[0]] || column[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a safe assumption that metric is always in position 0?

const label = column.map(s => verbose_map[s] || s).join(', ') may be more elegant but it may "verbosify" dimension members instead of metrics (collisions are probably rare and not super problematic). This problem exist here too as in this current case column[0] could be a metric or a dimension member anyhow.

Now I'm thinking verbosifying could be done in the backend where we know what is a metric or a dim member (this info is lost on the frontend). I know I said to verbosify it in the frontend earlier. What I wanted to avoid was using verbose names in dataframe column headers...

In any case I'll merge this to fix the bug and we can revisit later if needed.

Copy link
Contributor Author

@fabianmenges fabianmenges Oct 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, so my change for renaming on the backend is still around somewhere #3437.

Anyways your change #3563 as well as the original code also assumed it in the first position too.
There are some advantages (that we currently don't use) to do it in the front end.
E.g. we could have a checkbox that cloud switch between verbose and regular name or you could have custom verbose maps per slice instead of per datasource. And updating the charts would not require requests to the application.

So if we document and define that metrics always have to come before groupys we should be fine doing it in the UI.

@mistercrunch mistercrunch merged commit 15ecdeb into apache:master Oct 4, 2017
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.20.2 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.20.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

label for first group by clause in time series - bar chart is always undefined
3 participants