Filter.toString() throws IllegalFormatConversionException for withinGeoRange filters

Open Beginner friendly
#638 0 comments 0 reactions 0 assignees View on GitHub

@dudanogueira is already working on this.

Since Nov 10, 2026.

  • #639 by @dudanogueira — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
90/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
backend

Research direction

The issue points to src/main/java/io/weaviate/client6/v1/api/collections/query/Filter.java, specifically GeoRangeOperand.toString() around line 966. Read that method and run the supplied withinGeoRange example to reproduce the formatting exception. Update the float formatting as described, then confirm the example prints the filter without throwing.

Written by the indexing model from the issue text.

Description

toString() on a withinGeoRange filter throws IllegalFormatConversionException. GeoRangeOperand formats its floats with %d:

https://github.com/weaviate/java-client/blob/ff57caed14df5778ef715132d618383da559c1cc/src/main/java/io/weaviate/client6/v1/api/collections/query/Filter.java#L966

Why it matters

toString() runs implicitly in logging, error messages and test assertions. For example, throw new IllegalStateException("Query failed for " + filter, e) throws IllegalFormatConversionException instead, and the real error is lost. Geo range is the only operand affected. Found while testing the Kestra Weaviate plugin, which supports WITHIN_GEO_RANGE.

Reproduce (client6 6.3.2, no server needed)

import io.weaviate.client6.v1.api.collections.query.Filter;

public class GeoRangeToString {
    public static void main(String[] args) {
        System.out.println(Filter.property("location").withinGeoRange(52.52f, 13.40f, 2000f));
    }
}
Exception in thread "main" java.util.IllegalFormatConversionException: d != java.lang.Float
	...
	at io.weaviate.client6.v1.api.collections.query.Filter$GeoRangeOperand.toString(Filter.java:966)

Fix

return "(lat=%s, lon=%s, distance=%s)".formatted(lat, lon, distance);
Dominant language
Java
Stars
34
Forks
31
Avg merge
2d 10h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from weaviate/java-client

All issues in weaviate/java-client

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.