Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| | Func::ColorRgb | ||
| | Func::ColorRgba => true, | ||
| // Keep this exhaustive: a new function must decide whether dates are valid arguments. | ||
| // text_or_date also uses this distinction to reject numeric/date comparisons. |
There was a problem hiding this comment.
Confidence: medium. The comment says text_or_date "uses this distinction", but it doesn't fully. At query.rs:1042, text_or_date treats any function that is not in number_func's true arm as text, then carves out a second hand-written list: Func::Length | Func::Pi | Func::Area | Func::Perimeter | Func::LineLength. The exhaustive match only forces a decision in number_func, so a new function that returns a number but is placed in the false arm (as Length, Pi, Area etc. already are) is silently classified as text by text_or_date unless someone also remembers that second list. That is the same silent-misclassification the PR says it prevents.
Behaviour is unchanged by this PR, so this is not a regression. It is a gap the comment overstates. Options: make text_or_date an exhaustive match as well, or at least say in the comment that the exclusion list at line 1042 must also be updated for a new numeric-returning function.
Code reviewBugs
Security
Performance
Quality
AGENTS.md
Prior reviews
Change sizeCompared: the whole PR against main (merge base ce40749 to PR head 8f372c6).
|
|
Superseded by the combined data release-quality PR #2197. |
Summary
Make
number_funcan exhaustive match over the expression-function vocabulary. Adding a function now requires an explicit decision about numeric arguments before the parser compiles, preserving the date-comparison guard instead of silently classifying a new numeric function as text. Existing function behavior is unchanged.Handles the deferred release-quality point: #1325 (comment)
Testing
rustfmt --edition 2024 crates/data/src/query.rsandgit diff --checkpassed.cargo check -p rustgis-datapassed; full workspace tests are left to CI.UI evidence
No visible UI change.