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

[Bug Fix] Returning timeseries_limit_metric in table viz get_data #9196

Merged

Conversation

michellethomas
Copy link
Contributor

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

This change update the table viz's get_data, but was missing returning the timeseries_limit_metric (sort_by). If a metric has a custom label and a sort by field, not returning the sort_by field doesn't show the metric.

TEST PLAN

Tested a metric with a label and a sort by field

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@john-bodley

@codecov-io
Copy link

Codecov Report

Merging #9196 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9196      +/-   ##
==========================================
- Coverage   58.93%   58.91%   -0.03%     
==========================================
  Files         372      372              
  Lines       11987    11992       +5     
  Branches     2936     2936              
==========================================
  Hits         7065     7065              
- Misses       4742     4749       +7     
+ Partials      180      178       -2
Impacted Files Coverage Δ
superset-frontend/src/setup/setupApp.js
superset-frontend/src/setup/setupApp.ts 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1748728...391fa5e. Read the comment docs.

@michellethomas michellethomas changed the title Returning timeseries_limit_metric in table viz get_data [Bug Fix] Returning timeseries_limit_metric in table viz get_data Feb 25, 2020
Copy link
Member

@john-bodley john-bodley left a comment

Choose a reason for hiding this comment

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

@michellethomas apologies for the regression. Do you think it would be possible to augment the test case to add the timeseries limit metric?

@michellethomas
Copy link
Contributor Author

@john-bodley also needed to fix a similar issue with the include_time field too. I added a test for the timeseries_limit_metric. I'll add a test for include_time in a follow up PR.

superset/viz.py Outdated Show resolved Hide resolved

non_percent_metric_columns.extend(
utils.get_metric_names(self.form_data.get("metrics") or [])
)
Copy link
Member

Choose a reason for hiding this comment

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

How are lines 588 - 594 different to what was previously on lines 584 - 586?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm just extending them separately because it feels a bit more readable, rather than extending list + list.

@michellethomas michellethomas merged commit 4f73f8a into apache:master Feb 26, 2020
@michellethomas michellethomas deleted the fix_table_viz_sortby_with_label branch February 26, 2020 05:34
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 labels Feb 28, 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 size/XS 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants