Skip to main content

Convert Data Type

Convert values to strings, numbers, booleans, or datetimes.

Use convert.data_type when a recipe needs consistent Python-compatible values rather than display-only formatting.

Behavior​

  • Supported target types are str, float, int, bool, and datetime.
  • Omitting data_type uses the runtime default str.
  • Omitting output overwrites the input column.
  • Failed conversions retain the original value unless default is supplied.
  • Additional undocumented keyword arguments are implementation details and are not part of the public Registry contract.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName, index, or list of input columns.string, integer, array—Yes
outputName or list of output columns. If omitted, each input column is overwritten.string, arraynullNo
Options
data_typeData type to produce.string; one of:
  • str
  • float
  • int
  • bool
  • datetime
"str"No
Conditions
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
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
Errors
defaultValue returned when conversion fails. If omitted, the original value is retained.string, number, array, object, boolean, nullnullNo

Examples​

wrangles:
- convert.data_type:
input: quantity
output: quantity_integer
data_type: int
default: 0
quantity
12
not available
quantity_integer
12
0
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID6
Catalog keyconvert.data_type
Recipe keyconvert.data_type
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.data_type
Legacy UUID52384f01-7164-404f-8615-063e7677a588

Sources