Try
Try a list of wrangles and catch any errors that occur.
Run a list of wrangles and catch errors. When except is provided, its wrangles or fallback column values run after an error; otherwise, the error is logged and the recipe continues.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name. | array, object | — | No |
| Execution | ||||
wrangles | List of wrangles to apply. | array | — | Yes |
| Errors | ||||
retries | Number of times to retry the wrangles if an error occurs. Default 0. | integer | 0 | No |
except | An action to take if the wrangles encounter an error. This can contain a list of wrangles or a dictionary of column names and values. If except is not provided, the error will be logged and the recipe will continue. | object | — | No |
Examples
wrangles:
- try:
wrangles:
- risky_wrangle:
input: column
except:
- backup_wrangle:
input: column
The input dataframe is passed to the primary wrangles.
The primary result is returned on success; the except result is returned after an error.
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 98 |
| Catalog key | try |
| Recipe key | try |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | No |
| Recipe Writer exclusion | Error-control orchestration is not supported in the baseline. |
| Namespace | Root-level |
| Documentation group | utility |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.main.Try |
| Legacy UUID | None |
Sources