If I have a field which is boolean but the values ...
# getting-started
a
If I have a field which is boolean but the values are
'T'
and
'F'
, is there a way to use the typing helpers to cast them properly? using
th.BooleanType
makes it all true since the input strings are all truthy. Maybe a lambda?
e
a
amazing! thanks Edgar
I kinda wonder if this is a nudge towards not updating raw data and just dumping it as is to the target, managing the post processing downstream… seems like it’d be clunky to apply that postprocess at the stream level (ie, keeping the type as string so that I can apply the T/F -> true/false elsewhere)
e
keeping the type as string so that I can apply the T/F -> true/false elsewhere
oh, you can declare the field as
th.BooleanType
and use
post_process
to actually make it a boolean