I found the answer -
test = test.with_columns(
pl.when(pl.col(pl.Float32) > 8)
.then(0)
.otherwise(pl.col(pl.Float32)).name.keep()
)
I needed otherwise and to explicitly keep the column names. I thought the expression expansion was the issue but this works.