Right now we don't have a way to have variadic input args. For instance:
class ConcatenateHook(BaseHook):
hook_name: str = 'concat'
src: list = Field(
...,
description="A list to concatenate the items of.",
render_by_default=True,
)
args: list = ['src']
def exec(self) -> list:
Here we expect a string reference to an arg and any additional args are just joined into a list but this is not really what you want when concatting lists since you might want to render individual strings before joining them together. Instead you want a variadic which will take in any number of input args, rendering the strings and then joining them.
Would require changes to the parser as the render_by_default field level definition is processed there before the joining of the args. Might be a little too complicated to implement as we'd be having to check the Hook's arg field before doing the rendering.
This will take a little thinking but we should be able to do something like:
args: list = ['src', '...']
To indicate that there is any number of args which will get mapped to src.
The input could then be:
out->: concat list_1 list_2
Instead of:
out->: concat {{list_1}} {{list_2}}
This is kind of dumb as maybe you simply want list_1list_2 but that is what join hook is for.
Right now we don't have a way to have variadic input args. For instance:
Here we expect a string reference to an arg and any additional args are just joined into a list but this is not really what you want when concatting lists since you might want to render individual strings before joining them together. Instead you want a variadic which will take in any number of input args, rendering the strings and then joining them.
Would require changes to the parser as the render_by_default field level definition is processed there before the joining of the args. Might be a little too complicated to implement as we'd be having to check the Hook's
arg
field before doing the rendering.This will take a little thinking but we should be able to do something like:
To indicate that there is any number of args which will get mapped to src.
The input could then be:
Instead of:
This is kind of dumb as maybe you simply want
list_1list_2
but that is whatjoin
hook is for.