Repository navigation
Support none type - #553
Merged
Merged
Conversation
Anandbrewery
requested review from
azhiltsov,
deniszh,
emadolsky,
grzkv and
timtofan
as code owners
February 6, 2026 20:36
Author
|
hi @deniszh @grzkv @azhiltsov @timtofan @emadolsky should i submit this PR with single commit or multi commit for each change is fine. |
Author
deniszh
previously approved these changes
Oct 15, 2026
Contributor
|
Sorry, @Anandbrewery , could you please rebase with current master? |
Anandbrewery
force-pushed
the
support-none-type
branch
from
October 15, 2026 17:33
9a70c84 to
ea38c91
Compare
Author
|
@deniszh rebased it with master please do let me know if there is still any blocker from my side to close this PR |
deniszh
requested
a balanced review from Copilot
and removed request for
azhiltsov
October 15, 2026 17:46
There was a problem hiding this comment.
🟡 Changes recommended
Explicit nulls still fail in evaluation and named arguments, while string coercion can silently discard results.
3 open findings
What changed in this PR
Adds parser support for explicit None arguments, laying groundwork for the asPercent behavior requested in #295.
Changes:
- Introduces
EtNiland case-insensitiveNoneparsing. - Updates numeric and string argument handling.
- Adds standalone and function-argument parsing tests.
| File | Description |
|---|---|
| pkg/parser/parser.go | Recognizes None as EtNil. |
| pkg/parser/parser_test.go | Tests standalone and positional None parsing. |
| pkg/parser/internal.go | Adds null handling to argument accessors. |
| pkg/parser/interface.go | Defines the EtNil expression type. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Keep string/float arg accessors strict: None no longer silently becomes an empty string (e.g. exclude(metric, None) matched everything) - Accept None as a named argument value (func(metric, key=None)) - asPercent: total=None sums the input series, per group when nodes are given, matching graphite-web (fixes bookingcom#295) - Sum the group's own total series when several totals share a key - Add evaluation tests for asPercent with None and a named-arg parser test
Anandbrewery
force-pushed
the
support-none-type
branch
from
October 15, 2026 19:10
ff64d76 to
3ffbc3f
Compare
Author
deniszh
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What issue is this change attempting to solve?
PR is dedicated to resolve None type issue faced below
Fixes #295
How does this change solve the problem? Why is this the best approach?
How can we be sure this works as expected?
(go test -v ./pkg/parser/... -run TestParseExpr)