fix: propagate filter validation errors (#1092)

In Rust and Node, we have been swallowing filter validation errors. If
there was an error in parsing the filter, then the filter was silently
ignored, returning unfiltered results.

Fixes #1081
This commit is contained in:
Will Jones
2024-03-11 14:11:39 -07:00
committed by GitHub
parent 1ae08fe31d
commit ae1cf4441d
3 changed files with 20 additions and 3 deletions

View File

@@ -128,6 +128,11 @@ describe('LanceDB client', function () {
assertResults(results)
results = await table.where('id % 2 = 0').execute()
assertResults(results)
// Should reject a bad filter
await expect(table.filter('id % 2 = 0 AND').execute()).to.be.rejectedWith(
/.*sql parser error: Expected an expression:, found: EOF.*/
)
})
it('uses a filter / where clause', async function () {