weaviate/weaviate · warning

cannot convert %T to float64

Error message

cannot convert %T to float64

What it means

toFloat64 converts a property value to float64 for numeric decay scoring, accepting float64, float32, int, int64, and numeric strings. This error is returned when the value at the decay path is of any other type (bool, time.Time directly, arrays, objects). The caller treats errors as score 0, so objects silently lose their decay boost rather than failing the query.

Source

Thrown at usecases/traverser/boost_scorer.go:663

		return float64(d), nil
	}
	return strconv.ParseFloat(s, 64)
}

func toFloat64(val any) (float64, error) {
	switch v := val.(type) {
	case float64:
		return v, nil
	case float32:
		return float64(v), nil
	case int:
		return float64(v), nil
	case int64:
		return float64(v), nil
	case string:
		return strconv.ParseFloat(v, 64)
	default:
		return 0, fmt.Errorf("cannot convert %T to float64", val)
	}
}

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Point the decay path at a scalar numeric (int/float) or numeric-string property
  2. Fix the property type in the schema if it should be numeric
  3. Remove the decay boost or choose a different path

Example fix

// before
{path: "isActive", origin: 1, scale: 10}  // bool property
// after
{path: "activeCount", origin: 0, scale: 10}
Defensive patterns

Strategy: type-guard

Validate before calling

// ensure the decay path resolves to a scalar numeric property in the schema
schema, _ := client.Schema().Getter().WithClassName("Article").Do(ctx)
for _, p := range schema.Properties {
  if p.Name == "viewCount" {
    switch p.DataType[0] {
    case "int", "number": // ok
    default: log.Printf("decay path %s is not numeric", p.Name)
    }
  }
}

Type guard

func isNumericForDecay(v any) bool {
  switch v.(type) {
  case float64, float32, int, int64, string:
    return true
  }
  return false
}

Prevention

When it happens

Trigger: A decay boost path pointing at a boolean, date (time.Time value not matched earlier because tryParseDate handles strings — time.Time IS handled, so this fires for e.g. bool, []float64, geo coordinates, or object/nested values), or any non-numeric property type.

Common situations: Decay path misconfigured to a boolean flag or cross-reference property; schema changed the property type after the query was written; sending an array of numbers as the decay path value.

Related errors


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/6f253f1c2516688e. Report an issue: GitHub.