#Is it possible to use Lists/Sets in input parameters using python SDK?

1 messages · Page 1 of 1 (latest)

unreal locust
#

I got the following flags:

flavor: Annotated[List[str], Doc("Flavors to build.")],
secrets: Annotated[List[Secret], Doc(
  "Secrets to access the registry.")] = [],

I get a big error when calling my dagger module after adding those flags

#

/cc @lyric wedge

lyric wedge
#

Oh crap! Where are you importing List from? Collections or typing?

#
>>> from typing import List
>>> issubclass(List, type)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: issubclass() arg 1 must be a class
#

Just use normal list, no need for typing.List since Python 3.9.