#List[str] as parameter -> compile error
1 messages · Page 1 of 1 (latest)
@delicate whale try list[str] (lowercase) instead. That should work. i.e: https://dagger-io.readthedocs.io/en/sdk-python-v0.12.4/_modules/dagger/client/gen.html#Container.experimental_with_gpu
i.e:
@object_type
class Test:
@function
def container_echo(self, string_arg: list[str]) -> dagger.Container:
"""Returns a container that echoes whatever string argument is provided"""
return dag.container().from_("alpine:latest").with_exec(string_arg)
and then
dagger call container-echo --string-arg echo,hello stdout
^ that works. Just tested it
That works! Thanks
just for others it seems like dict[str, str] seems to work as well. Just checking
yup looks like it works as an argument. Calling it from code worked for me although I have no idea how to pass that dict argument when invoked from the CLI
passing a dict via the CLI is not currently possible