-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Specify the metric to order by for Series Limit #1351
Conversation
842b1a7
to
bc43be3
Compare
👍 Thanks a lot Maxime. Your very quick help was well above my expectation :) |
subq = subq.order_by(desc(main_metric_expr)) | ||
ob = main_metric_expr | ||
if timeseries_limit_metric_expr is not None: | ||
ob = timeseries_limit_metric_expr |
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.
same here.
timeseries_limit_metric_expr = None | ||
if timeseries_limit_metric: | ||
timeseries_limit_metric_expr = \ | ||
timeseries_limit_metric.sqla_col |
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.
minor: how about ternary?
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.
too long for PEP8's 80 char limit
@@ -1689,6 +1699,7 @@ def query( # druid | |||
filter=None, # noqa | |||
is_timeseries=True, | |||
timeseries_limit=None, | |||
timeseries_limit_metric=None, |
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.
umm why do we need to override this here?
timeseries_limit_metric = metrics_dict.get(timeseries_limit_metric) | ||
timeseries_limit_metric_expr = None | ||
if timeseries_limit_metric: | ||
timeseries_limit_metric_expr = \ |
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.
just curious, what's \
at the end? (am new to python)
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.
python's way of terminating a line on another line
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.
👍
bc43be3
to
472bdf7
Compare
@mistercrunch Hi, do you have any plan on enabling metrics ordering? For example, I want to show the first metric on the left in the visualization, but it is always the largest on the left. Just asking... I know you have to prioritize everything. Thanks a lot! |
How to specify the order by on metrics (computed columns) ? |
…pache#1351) * feat: add x and y label support for timeseries fix apache#16512 * feat: change label to title * feat: add x/y title to 9 chats * refactor: move config to shared-control * refactor: add chartTitle section config in custom tab * refactor: refactor param names * lint: code lint * refactor: refactor code * lint: lint code * feat: make ypostion clearable false * lint: code lint Co-authored-by: xuzhebin <maxhui2020@gmail.com>
…pache#1351) * feat: add x and y label support for timeseries fix apache#16512 * feat: change label to title * feat: add x/y title to 9 chats * refactor: move config to shared-control * refactor: add chartTitle section config in custom tab * refactor: refactor param names * lint: code lint * refactor: refactor code * lint: lint code * feat: make ypostion clearable false * lint: code lint Co-authored-by: xuzhebin <maxhui2020@gmail.com>
…pache#1351) * feat: add x and y label support for timeseries fix apache#16512 * feat: change label to title * feat: add x/y title to 9 chats * refactor: move config to shared-control * refactor: add chartTitle section config in custom tab * refactor: refactor param names * lint: code lint * refactor: refactor code * lint: lint code * feat: make ypostion clearable false * lint: code lint Co-authored-by: xuzhebin <maxhui2020@gmail.com>
…pache#1351) * feat: add x and y label support for timeseries fix apache#16512 * feat: change label to title * feat: add x/y title to 9 chats * refactor: move config to shared-control * refactor: add chartTitle section config in custom tab * refactor: refactor param names * lint: code lint * refactor: refactor code * lint: lint code * feat: make ypostion clearable false * lint: code lint Co-authored-by: xuzhebin <maxhui2020@gmail.com>
Used to be based on the first metric from the metric multi-choice, but there's the use case where you don't want to show the metric you are sorting by. It will still default to use the first metric if the new select is empty