Hi all, I'm trying to use a map_task for a task th...
# ask-the-community
t
Hi all, I'm trying to use a map_task for a task that takes an attribute of a dataclass as an input, but the workflow is stuck in a loop. Given a dataclass A with an attribute "a" of type str, and an output of a map_task of type List[A], is there a way to access the dataclass attribute using list comprehension(or something similar to retrieve A.a), so I will have an object of type List[str]? Meaning- is there a way to iterate over an output of type "list"?
c
What's the type of
a
?
t
@Cornelis Boon str
c
Sure.
[ A_obj.a for A_obj in A_list]
should get you your list of `a`s, right?
Where
A_list
is some
List[A]
t
@Cornelis Boon Seems to be stuck in a loop in my case.. I figured it isn't supported
c
Could you post a snippet of your code?