shell-functools
shell-functools copied to clipboard
Offering: Allow `join` function to work on a single column
The current join
function fails if a line of input only has one column (i.e., not an array). The update below allow it to function in that case:
@register("join")
@typed(None, T_STRING)
def join(separator, inp):
if type(inp) == list:
separator = dynamic_cast(T_STRING, separator).value
vals = map(lambda x: T_STRING.create_from(x).value, inp)
return separator.join(vals)
return inp # Only one 'column'
Thanks. Please see the other tickets regarding the maintenance status of this project.