Filter.toString() throws IllegalFormatConversionException for withinGeoRange filters
评估
调研方向
Issue 指向 src/main/java/io/weaviate/client6/v1/api/collections/query/Filter.java,具体是约第 966 行的 GeoRangeOperand.toString()。阅读该方法并运行提供的 withinGeoRange 示例,以重现格式异常。按照描述更新 float 格式化,然后确认示例打印筛选器时不会抛出异常。
由索引模型根据 Issue 内容生成。
描述
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);
- 主要语言
- Java
- 星标
- 34
- 派生
- 31
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
weaviate/java-client 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 62/100
weaviate/java-client#635 ·
-
v6: VersionSupport rejects every 2.x server (major and minor are concatenated)可能已有人在做 @Ashlesha-17 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
weaviate/java-client#631 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
weaviate/java-client#630 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
weaviate/java-client#629 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
weaviate/java-client#628 ·
查看 weaviate/java-client 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 63/100
linagora/twake-calendar-side-service#1578 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
tchiotludo/akhq#3438 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#266 ·
维护者通常 1 天内回复