This behavior is expected, as the contract is:
When columns
colsof data framedfhave iterable elements that definelength
You would have to complain to Julia Base why AbstractString is iterable and defines length
. This is a common issue with strings in general.
How would you propose to change things in DataFrames.jl? We could special case AbstractStrings and throw an error if you try to flatten them.
Now I see that @sijo commented the same already. This is exactly the issue that strings are collections in Julia. Actually numbers are also collections, but they are 1-element collections so you would not have a problem in this case.