Commit 6414430
committed
fix(pinecone): handle float32 precision loss in assert_documents_are_equal
Pinecone stores embedding vectors as float32 internally, so values round-tripped
through the store may differ from the original float64 values in filterable_docs.
Document.__eq__ uses to_dict() which includes the embedding list, causing
test_filter_simple_async and test_filter_compound_async to fail even when all
other fields match.
Fix: compare documents sorted by ID with embedding fields stripped, verifying
only that embedding presence (None vs non-None) matches. Exact float values are
not the invariant under test in filter tests.1 parent cc71560 commit 6414430
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
| |||
0 commit comments