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

Adding the MetricsControl to the timeseries_limit_metric field #5118

Merged
merged 3 commits into from Jun 14, 2018

Conversation

michellethomas
Copy link
Contributor

Making timeseries_limit_metric (sort by) use the MetricsControl.

@GabeLoins

@codecov-io
Copy link

codecov-io commented May 31, 2018

Codecov Report

Merging #5118 into master will increase coverage by <.01%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5118      +/-   ##
==========================================
+ Coverage   77.46%   77.47%   +<.01%     
==========================================
  Files          44       44              
  Lines        8730     8740      +10     
==========================================
+ Hits         6763     6771       +8     
- Misses       1967     1969       +2
Impacted Files Coverage Δ
superset/data/__init__.py 100% <ø> (ø) ⬆️
superset/connectors/druid/models.py 80.56% <100%> (+0.07%) ⬆️
superset/viz.py 81.3% <100%> (+0.01%) ⬆️
superset/connectors/sqla/models.py 78.08% <50%> (-0.14%) ⬇️

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 d6846d9...b380a57. Read the comment docs.

@@ -1148,6 +1148,11 @@ def run_query( # noqa / druid
metric['column']['type'].upper() == 'FLOAT'
):
metric['column']['type'] = 'DOUBLE'
if (
utils.is_adhoc_metric(timeseries_limit_metric) and
timeseries_limit_metric['column']['type'].upper() == 'FLOAT'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you also need to add a version check here, see:

https://github.com/apache/incubator-superset/pull/5030/files

Copy link
Contributor

Choose a reason for hiding this comment

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

unless this is a different thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

O i see

Copy link
Member

Choose a reason for hiding this comment

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

It's almost the exact same code as a few lines above, maybe refactor a sanitize_metric_object and put as much as possible in there.

[probably out of scope for this PR] I'm starting to think we should make all metrics fit the same model (make predefined metrics look like custom metric objects) as early as possible in the stack and then treat them all the same way.

@gabe-lyons
Copy link
Contributor

LGTM aside from the comment--- thanks for doing this!

@michellethomas
Copy link
Contributor Author

Actually, I need to fix an issue with this on the table viz.

@michellethomas
Copy link
Contributor Author

Sorry for the delay, I fixed the issue with Table viz and addressed PR comments. I created an issue to track the task Max suggested that's out of scope for this PR. @GabeLoins @mistercrunch

@mistercrunch
Copy link
Member

LGTM

@timifasubaa timifasubaa merged commit 66ffcb6 into apache:master Jun 14, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
…l_sort_by

Adding the MetricsControl to the timeseries_limit_metric field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants