mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 20:44:00 +00:00
feat(nodejs): expose Function failure recovery APIs (#5209)
TypeScript callers can now inspect and recover Function row failures through the native workflow. `functionErrors()` groups returned failures and can show retained attempt history. `functionErrorRows()` looks up current failed inputs using row IDs and physical row addresses represented as `bigint`. Older deployments can continue to use the existing error listing. `retryFailed()` selects the exact failed rows on the server, with optional error type and job filters. `upgradeColumn()` binds an existing immutable Function version and can recompute failed rows, all eligible rows, or no rows. Callers can quarantine and release failures, explicitly include quarantined rows in a retry, and use `functionProvenance()` to see which Function version produced a recorded value. The native operations reuse the existing Rust workflow v1 capability checks. The Function failures guide includes TypeScript examples for inspecting, retrying, upgrading, and quarantining failures.
This commit is contained in:
@@ -6474,18 +6474,35 @@ describe("durable compaction validation", () => {
|
||||
});
|
||||
|
||||
describe("Enterprise table overrides", () => {
|
||||
it("keeps override methods optional for existing custom Table subclasses", async () => {
|
||||
// Declare the old Table surface; only the new methods must be inherited.
|
||||
// Keeping these override methods abstract must fail type checking here.
|
||||
it("keeps added operations optional for existing custom Table subclasses", async () => {
|
||||
// Declare the old Table surface; the new methods must be inherited.
|
||||
// biome-ignore lint/correctness/noUnusedVariables: declaration merging supplies the legacy members
|
||||
interface LegacyTable
|
||||
extends Omit<
|
||||
Table,
|
||||
"getTableOverrides" | "updateTableOverrides" | "resetTableOverrides"
|
||||
| "getTableOverrides"
|
||||
| "updateTableOverrides"
|
||||
| "resetTableOverrides"
|
||||
| "functionErrors"
|
||||
| "functionErrorRows"
|
||||
| "retryFailed"
|
||||
| "upgradeColumn"
|
||||
| "quarantineFailed"
|
||||
| "functionProvenance"
|
||||
> {}
|
||||
class LegacyTable extends Table {}
|
||||
class LegacyTable extends Table {
|
||||
async functionErrors() {
|
||||
return { records: [], fragments: [], truncated: false };
|
||||
}
|
||||
}
|
||||
|
||||
const table = new LegacyTable();
|
||||
await expect(table.functionErrorRows()).rejects.toThrow(
|
||||
"Function row-failure workflow",
|
||||
);
|
||||
await expect(table.retryFailed("embedding")).rejects.toThrow(
|
||||
"retryFailed is not supported on this table type",
|
||||
);
|
||||
await expect(table.delta(1)).rejects.toThrow(
|
||||
"table.delta is only supported on LanceDB Embedded tables",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user