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

[query] Fix Graphite nil arg not interpreted as explicit nil for asPercent #3481

Merged
merged 1 commit into from
May 7, 2021

Conversation

robskillington
Copy link
Collaborator

What this PR does / why we need it:

By default Graphite uses nil to mean take the sum of the numerator as the denominator. Using an empty list as the default value for the total arg causes it not to be interpreted as explicit nil and instead for it to treat it as an empty fetch expression that fetched no series which then causes an error (which is correct if you fetched no series, but in this case the correct behavior is to use the sum of the numerator as the denominator).

This also fixes Graphite function execution to allow passing explicit nil as arguments since before it would cause issues unwrapping the nil without checking during function call execution.

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:


Does this PR require updating code package or user-facing documentation?:


@robskillington robskillington enabled auto-merge (squash) May 7, 2021 07:20
@codecov
Copy link

codecov bot commented May 7, 2021

Codecov Report

Merging #3481 (85324b1) into master (4df4556) will increase coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3481   +/-   ##
======================================
  Coverage    55.8%   55.9%           
======================================
  Files         548     548           
  Lines       61188   61188           
======================================
+ Hits        34167   34218   +51     
+ Misses      23924   23881   -43     
+ Partials     3097    3089    -8     
Flag Coverage Δ
aggregator 57.3% <ø> (ø)
cluster ∅ <ø> (∅)
collector 54.3% <ø> (ø)
dbnode 60.3% <ø> (+0.1%) ⬆️
m3em 46.4% <ø> (ø)
metrics 19.8% <ø> (ø)
msg 74.5% <ø> (+0.2%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.


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 4df4556...85324b1. Read the comment docs.

Copy link
Collaborator

@linasm linasm left a comment

Choose a reason for hiding this comment

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

LGTM with minor nit - I thought that maybe test data could have some additional variety in it.

@robskillington robskillington merged commit d838a75 into master May 7, 2021
@robskillington robskillington deleted the r/fix-aspercent-nil-total-arg branch May 7, 2021 08:59
soundvibe added a commit that referenced this pull request May 10, 2021
* master:
  [query] Add Graphite movingWindow() function (#3484)
  [lint] Add missing build tags to linter configuration (#3480)
  [query] Fix Graphite nil arg not interpreted as explicit nil (#3481)
  [query] Fix Graphite context time window expansions not being cumulative
  [readme] Remove coverage badge due to CodeCov not able to execute (#3476)
  [query] Fix using median with aggregateWithWildcards and support more aggregate functions (#3469)
  [matcher] [coordinator] Add RequireNamespaceWatchOnInit option (#3468)
  [buildkite] Remove codecov uploading from unit tests (#3475)
  [aggregator] Add integration test for aggregator placement changes (#3465)
  [tools] Use streaming reads in read_data_files (#3474)
  [tools] Close the reader in read_data_files (#3473)
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.

3 participants