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, anddatetime. - Omitting
data_typeuses the runtime defaultstr. - Omitting
outputoverwrites the input column. - Failed conversions retain the original value unless
defaultis supplied. - Additional undocumented keyword arguments are implementation details and are not part of the public Registry contract.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | Name, index, or list of input columns. | string, integer, array | — | Yes |
output | Name or list of output columns. If omitted, each input column is overwritten. | string, array | null | No |
| Options | ||||
data_type | Data type to produce. | string; one of:
| "str" | No |
| Conditions | ||||
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 |
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
| Errors | ||||
default | Value returned when conversion fails. If omitted, the original value is retained. | string, number, array, object, boolean, null | null | No |
Examples
wrangles:
- convert.data_type:
input: quantity
output: quantity_integer
data_type: int
default: 0
| quantity |
|---|
| 12 |
| not available |
| quantity_integer |
|---|
| 12 |
| 0 |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 6 |
| Catalog key | convert.data_type |
| Recipe key | convert.data_type |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | convert |
| Documentation group | convert |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.convert.data_type |
| Legacy UUID | 52384f01-7164-404f-8615-063e7677a588 |
Sources