Filter.toString() throws IllegalFormatConversionException for withinGeoRange filters
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
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:
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from weaviate/java-client
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
weaviate/java-client#635 ·
-
v6: VersionSupport rejects every 2.x server (major and minor are concatenated)Possibly taken @Ashlesha-17 claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
weaviate/java-client#631 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
weaviate/java-client#630 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
weaviate/java-client#629 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
weaviate/java-client#628 ·
All issues in weaviate/java-client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
linagora/twake-calendar-side-service#1578 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
tchiotludo/akhq#3438 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#266 ·
Maintainers usually reply within 1 day