Skip to main content

Dictionaries

Take dictionaries in multiple columns and merge them to a single dictionary.

note

For duplicate keys, the last key in the input list takes precedence in the merged dictionary.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputList of input columns.array—Yes
outputName of the output column.string—Yes
Options
skip_emptyWhether to skip empty dictionaries when merging.booleanfalseNo
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

Examples​

wrangles:
- merge.dictionaries:
input:
- Dict 1
- Dict 2
output: Merged
Dict 1Dict 2
{'First': 'One'}{'Second': 'Two'}
Merged
{'First': 'One', 'Second': 'Two'}
# Using a Wildcard (*)
wrangles:
- merge.dictionaries:
input: Dict *
output: Merged
Dict 1Dict 2
{'First': 'One'}{'Second': 'Two'}
Merged
{'First': 'One', 'Second': 'Two'}
# Using a Wildcard (*)
wrangles:
- merge.dictionaries:
input:
- Dict *
- -Dict 2
output: Merged

Note the extra dash in front of Dict 2 excludes that column from the wildcard selection.

Dict 1Dict 2Dict 3
{'First': 'One'}{'Second': 'Two'}{'Third': 'Three'}
Merged
{'First': 'One', 'Third': 'Three'}
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID42
Catalog keymerge.dictionaries
Recipe keymerge.dictionaries
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespacemerge
Documentation groupmerge
AliasesNone
Runtime symbolwrangles.recipe_wrangles.merge.dictionaries
Legacy UUID93e27737-e966-4ba9-8777-4e96724ebfc4

Sources