When I cast booleans to string, they get converted...
# general
k
When I cast booleans to string, they get converted to "1"/"0" instead of "true"/"false". Is there any way to get around this or do I have to do an ifelse/replace?
Copy code
daft.read_parquet('<hf://datasets/HuggingFaceH4/stack-exchange-preferences/').explode(>"answers").with_column("selected", daft.col("answers").struct.get("selected").cast(daft.DataType.bool())).with_column("selected_str", daft.col("selected").cast(daft.DataType.string())).show()
j
You probably want an if else to be more explicit — casts are very naive :)
k
Okay haha thanks!