shell-functools icon indicating copy to clipboard operation
shell-functools copied to clipboard

Offering: Allow `join` function to work on a single column

Open jdhedden opened this issue 2 years ago • 1 comments

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'

jdhedden avatar May 09 '22 19:05 jdhedden

Thanks. Please see the other tickets regarding the maintenance status of this project.

sharkdp avatar May 22 '22 09:05 sharkdp