Skip to main content

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​

NameDescriptionAccepted ValuesDefaultRequired
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No
Execution
wranglesList of wrangles to apply.array—Yes
Errors
retriesNumber of times to retry the wrangles if an error occurs. Default 0.integer0No
exceptAn 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
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID98
Catalog keytry
Recipe keytry
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleNo
Recipe Writer exclusionError-control orchestration is not supported in the baseline.
NamespaceRoot-level
Documentation grouputility
AliasesNone
Runtime symbolwrangles.recipe_wrangles.main.Try
Legacy UUIDNone

Sources