docs: describe current Function refresh defaults (#5134)

Several Function pages still said a refresh defaults to `error_policy =
'fail'` and that `skip` writes null outputs. The server now defaults new
refreshes to skip with a 5% failed-row ceiling, and skip keeps a row's
existing output, leaving only never-filled rows empty. This updates
those pages to match.
This commit is contained in:
Brendan Clement
2026-11-20 12:47:31 -08:00
committed by GitHub
parent 13fe33581e
commit 74239973c7
5 changed files with 27 additions and 23 deletions
+5 -3
View File
@@ -121,9 +121,11 @@ That is also why a function must declare the environment it needs.
## Recovering from a failure {#failures}
A function that raises fails the job. There is no per-row retry or skip policy
in the function definition, so a function calling a flaky external service
should handle that itself, inside the function body.
By default, a refresh skips rows where the function raises and records their
errors, up to a 5% failed-row ceiling; see
[Handle Function failures](/management/function-failures). A function can also
declare a retry policy for transient errors with `@function(retry_policy=...)`
where the SDK, server and Function image support it.
When a refresh fails, fix the cause and run the refresh
again. The new refresh fills what is still empty or stale. How much of the
@@ -536,8 +536,9 @@ refresh value overrides that default for this execution only.
`batch_size` caps rows in one Function call; LanceDB adapts actual call and
work sizes. For Function columns, the refresh defaults to
`error_policy = 'fail'`. Set `error_policy = 'skip'` to write null outputs for
failing rows and record them in the error store, subject to failure limits.
`error_policy = 'skip'` with a 5% failed-row ceiling: failing rows keep any
existing output, unassigned outputs stay unassigned, and their errors are
recorded in the error store. Set `error_policy = 'fail'` to stop on a row error.
See the [SQL refresh options](/sql/dml/refresh-column#options).
{/*
+11 -12
View File
@@ -11,18 +11,16 @@ availability:
A Function refresh can encounter a bad row, fail to initialize a model, lose
a worker, or fail while publishing results. These need different remedies.
The native workflow below is draft guidance for an unreleased SDK and a
matching Enterprise server. The recipes that follow it remain available for
older deployments.
The native workflow below needs a recent SDK and a matching Enterprise server.
The recipes that follow it remain available for older deployments.
## Draft native workflow: server contract version 1 {#native}
## Native workflow: server contract version 1 {#native}
This section requires the SDK changes in [PR #5048](https://github.com/lancedb/lancedb/pull/5048)
and an Enterprise deployment advertising `workflow_version >= 1` in its
Function error response. No released SDK or Enterprise version is implied by
this draft. The SDK checks this capability before submitting native retry,
upgrade, quarantine, history or provenance requests, and rejects unsupported
servers before changing the column.
This section requires Python SDK 0.42.0b19 or later and an Enterprise
deployment advertising `workflow_version >= 1` in its Function error response.
The SDK checks this capability before submitting native retry, upgrade,
quarantine, history or provenance requests, and rejects unsupported servers
before changing the column.
New Function refreshes default to `error_policy="skip"` with a 5% failed-row
ceiling. Successful outputs are published before a threshold failure is
@@ -145,8 +143,9 @@ remain unchanged.
## Choose a row-error policy {#policy}
The default `fail` stops the job on a row error. `skip` writes null outputs for
failed rows and records errors, subject to the refresh's failure limits:
On these deployments, the default `fail` stops the job on a row error. `skip`
retains a failed row's existing output, leaves an unassigned output unassigned
and records errors, subject to the refresh's failure limits:
```python
job = table.refresh_column_async(
+7 -5
View File
@@ -696,23 +696,25 @@ full worked example.
For the full skip, inspect, grouped-error, stable-row-ID retry and quarantine
workflow, see [Handle Function failures](/management/function-failures).
By default, a Function that raises fails the refresh job. Choose how the
refresh handles row errors with its error policy:
By default, a refresh skips rows where the Function raises, up to a 5%
failed-row ceiling. Choose how the refresh handles row errors with its error
policy:
<CodeGroup>
```sql SQL icon="database"
REFRESH COLUMN embedding ON documents WITH (error_policy = 'skip')
REFRESH COLUMN embedding ON documents WITH (error_policy = 'fail')
```
</CodeGroup>
`skip` writes null outputs for failing rows and records their errors. Inspect
`skip` retains a failing row's existing output, leaves an unassigned output
unassigned and records the error. Inspect
them with `SHOW ERRORS` or `table.function_errors()`. Failure limits still
apply, and initialization or infrastructure failures can still fail the job.
See the [SQL refresh options](/sql/dml/refresh-column#options). A Function
that calls a transiently failing external service can handle bounded retries
inside its body.
Letting the job fail is the other option: fix the cause and refresh again. The
`fail` is the opt-in alternative: fix the cause and refresh again. The
next unfiltered refresh [skips rows that are filled and current](/feature-engineering/refresh-column#idempotent),
but how much of the failed job's work was kept is not guaranteed, so do not
count on the retry costing only the rows that did not complete. A refresh with
+1 -1
View File
@@ -59,7 +59,7 @@ to let LanceDB track which outputs need updating.
| `batch_size` | maximum rows passed to one Function call; actual calls can be smaller. Function columns only |
| `max_executor_processes_per_worker` | cap on executor processes per worker. Function columns only |
| `row_timeout_seconds` | deadline for one Function call. Function columns only |
| `error_policy` | `'fail'` (default) stops on a row error; `'skip'` writes null outputs and records row errors, subject to failure limits. Function columns only |
| `error_policy` | `'skip'` (default, with a 5% failed-row ceiling) retains a failing row's existing output, leaves unassigned outputs unassigned and records row errors, subject to failure limits; `'fail'` stops on a row error. Function columns only |
| `max_failed_fraction` | fail the job once more than this share of rows has failed. Function columns only |
| `max_failed_rows` | fail the job once more than this many rows has failed. Function columns only |