as described in this discussion, the result of flattening a dataframe on a column containing arrays and strings is, in my opinion, unexpected.
A possible modification could include at least one keyword that optionally allows the possibility of managing the scalar-string elements as vectors of length 1.