weaviate/weaviate · error
filtering for integer, but received a non-finite number %v
Error message
filtering for integer, but received a non-finite number %v
What it means
Validation error from floatToInt during int-property filter coercion: the numeric value is NaN or ±Inf, which has no integer representation. floatToInt deliberately rejects these rather than relying on Go's implementation-defined float→int conversion, so the filter is refused instead of silently becoming an arbitrary integer.
Source
Thrown at adapters/handlers/grpc/v1/filters.go:389
return nil, "", fmt.Errorf("unknown target type %v", target)
}
}
// floatToInt safely converts a float64 to int for use as an integer filter
// value. It rejects NaN, ±Inf, values outside the int64 range, and fractional
// values. This allows whole-number floats (e.g. 2.0 or "2.0") to be accepted
// as a convenience, while avoiding Go's implementation-defined behavior for
// out-of-range float→int conversions and silent truncation of fractional
// values.
//
// Note: float64 cannot represent every int64 exactly. Values near the int64
// boundary that ParseFloat rounds up to float64(math.MaxInt64) = 2^63 are
// rejected as out of range. Callers that need exact large integers should
// use the native integer filter value instead of float/text.
func floatToInt(v float64) (int, error) {
switch {
case math.IsNaN(v) || math.IsInf(v, 0):
return 0, fmt.Errorf("filtering for integer, but received a non-finite number %v", v)
case v < float64(math.MinInt64) || v >= float64(math.MaxInt64):
return 0, fmt.Errorf("filtering for integer, but received a value out of range %v", v)
case math.Trunc(v) != v:
return 0, fmt.Errorf("filtering for integer, but received a floating point number %v", v)
}
return int(v), nil
}
View on GitHub (pinned to 75aa4b6d11)
Solutions
- Send a finite integer value
- Fix client-side computation that produced NaN/Inf
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at adapters/handlers/grpc/v1/filters.go:389 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/62ff56f991389c6d.
Report an issue: GitHub.