fix: review hardening — count_over_time dtype, SampleValue binding, range guard (#69, #70, #71) - #75
Merged
Merged
Conversation
…ange guard (#69, #70, #71) Folds the three low/hardening findings from the whole-repo review: #69 — count_over_time value column typed Int64 instead of Float64. per_series_reduction_schema now forces the value dtype to Float64: a per-series range reduction always produces a PromQL float sample value, so every reducer (incl. count_over_time, whose Count intent types Int64) matches. + conformance test. #70 — SampleValue could bind a label column. The `SampleValue` fallback tried "the sole non-timestamp column of any type" before "the sole numeric column", so a `[ts, host:Utf8]` schema bound to `host`. Dropped the type-agnostic step; the numeric-only fallback subsumes every legitimate case and now fails cleanly on a label-only schema. + unit test. #71 — counter-derivative could be emitted range-less. If a changes/delta/deriv/resets/idelta/predict_linear/double_exp intent reaches the converter without an enclosing Window (unlike rate/increase it carries no window in its AggFunc), the range would be silently dropped. Added a ConvertError::RangelessRangeReduction guard. + unit test. (Defensive: the front ends always wrap these in a Window today.) No behavior change on valid input; full workspace suite green; clippy clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Folds the three low/hardening findings from the whole-repo review into one PR.
#69 —
count_over_timevalue column typedInt64(was wrong dtype)per_series_reduction_schemanow forces the value column toFloat64. A per-series range reduction always produces a PromQL float sample value, socount_over_time(whoseCountintent typesInt64) now matches every other reducer. Verified:count_over_time(m[5m])→value: Float64. + conformance test.#70 —
SampleValuecould bind a label column (latent)The fallback tried "the sole non-timestamp column of any type" before "the sole numeric column", so a
[ts, host:Utf8]schema boundSampleValuetohost. Dropped the type-agnostic step — the numeric-only fallback subsumes every legitimate case and now fails cleanly (NoSampleValue) on a label-only schema. + unit test.#71 — counter-derivative could be emitted range-less (defensive)
If a
changes/delta/deriv/resets/idelta/predict_linear/double_expintent reaches the converter without an enclosingWindow(unlikerate/increaseit carries no window in itsAggFunc), the range would be silently dropped. Added aConvertError::RangelessRangeReductionguard. + unit test. (The front ends always wrap these in aWindowtoday, so this is a defensive backstop.)No behavior change on valid input; full workspace suite green (29 binaries); clippy
--all-targetsclean.Closes #69, closes #70, closes #71.
🤖 Generated with Claude Code