-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
fix: EAP timeseries order, add weight to calculations #6302
Conversation
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.
I'm nervous about enabling weight by default, but maybe i'm just missing context there
Some minor typos (i think) otherwise lgtm
return f.sum(key_col, alias="sum") | ||
if request.aggregate == AggregateBucketRequest.FUNCTION_AVERAGE: | ||
return f.avg(key_col, alias="avg") | ||
return f.sum(f.multiply(key_expr, sampling_weight_times_sign), alias="sum") |
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.
Does this make all the functions the weighted ones by default using sampling_weight_2
? Isn't that going to cause some confusion since that column is empty for older data right now
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.
it defaults to 1, which would be equivalent
Co-authored-by: William Mak <william@wmak.io>
I think we'll need a way to show a summary of the extrapolation: average sampling rate, variance, total count of samples and total extrapolated count. |
The old tests used the same number a bunch of times, so there was a bug where the results were not ordered by time.
This makes the tests a lot more robust and implements weight in the aggregate functions