Lookup
Lookup values from a saved lookup wrangle.
Look up data from a saved Lookup Wrangle. Data is output as a dictionary if an output is not specified or the output does not match any columns in the lookup. If specific lookup columns are named in the output, they will be output as individual columns.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | Name of the column(s) to lookup. | string | — | Yes |
output | Name of the output column(s). When n is provided and the output list length equals n, each output column receives the corresponding match. A single output containing a wildcard (*) is expanded into n columns, e.g. "Top *" with n: 3 becomes "Top 1", "Top 2", "Top 3". | string, array, null | null | No |
| Options | ||||
lookup_mode | How to perform lookups. 'by_row' (default): lookup each row individually. 'by_dataframe': lookup unique values once, copy results to all rows. 'by_matrix': lookup once per matrix permutation. | string; one of:
| "by_row" | No |
n | Number of matches to return per input value. When the output list length equals n, each output column receives the corresponding match. Otherwise all n matches are stored as a list in each output column. | integer, null | null | No |
| 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 |
| Details | ||||
model_id | The model_id to use lookup against. | string, null | null | No |
Examples
wrangles:
- lookup:
input: State
output:
- Abbreviation
model_id: 55555555-5555-5555
| State |
|---|
| Texas |
| New York |
| Virginia |
| Abbreviation |
|---|
| TX |
| NY |
| VA |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 81 |
| Catalog key | lookup |
| Recipe key | lookup |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | Root-level |
| Documentation group | lookup |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.main.lookup |
| Legacy UUID | b3339193-d1cc-4c89-8ed6-901efa6d81be |
Sources