Skip to content

fix: review hardening — count_over_time dtype, SampleValue binding, range guard (#69, #70, #71) - #75

Merged
zzylol merged 1 commit into
mainfrom
fix/review-hardening-69-70-71
Jul 2, 2026
Merged

fix: review hardening — count_over_time dtype, SampleValue binding, range guard (#69, #70, #71)#75
zzylol merged 1 commit into
mainfrom
fix/review-hardening-69-70-71

Conversation

@zzylol

@zzylol zzylol commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Folds the three low/hardening findings from the whole-repo review into one PR.

#69count_over_time value column typed Int64 (was wrong dtype)

per_series_reduction_schema now forces the value column to Float64. A per-series range reduction always produces a PromQL float sample value, so count_over_time (whose Count intent types Int64) now matches every other reducer. Verified: count_over_time(m[5m])value: Float64. + conformance test.

#70SampleValue could 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 bound SampleValue to host. 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_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. (The front ends always wrap these in a Window today, so this is a defensive backstop.)

No behavior change on valid input; full workspace suite green (29 binaries); clippy --all-targets clean.

Closes #69, closes #70, closes #71.

🤖 Generated with Claude Code

…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>
@zzylol
zzylol merged commit 6ef3c46 into main Jul 2, 2026
1 check passed
@zzylol
zzylol deleted the fix/review-hardening-69-70-71 branch July 2, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant