Lana Dann

    Lana Dann

    3 months ago
    is it possible to have a flow that has a dynamic number of tasks? for example: task 1: get a list of values for each value, kick off a task
    Kevin Kho

    Kevin Kho

    3 months ago
    Kind of with task looping, but not a sequence of tasks
    Lana Dann

    Lana Dann

    3 months ago
    😮 very cool. i will look into it thank you
    Michael Adkins

    Michael Adkins

    3 months ago
    Also mapping would work for this simple case.
    Kevin Kho

    Kevin Kho

    3 months ago
    ^ as long as the sequential order does not matter
    Lana Dann

    Lana Dann

    3 months ago
    is it possible to do mapping with a task that takes in 2 arguments? e.g.
    tuples = [(1, 1), (2, 2), (3, 4)]
    map_task = task(lambda x, y: x + y)
    
    with Flow('Tuple Maps') as flow:
        map_task.map(tuples)
    i tried this and am getting
    TypeError: missing a required argument: 'y'
    ignore me lol. i realize i can just do something like:
    @task
    def map_task(tup):
        x, y = tup
        return x + y
    
    ...
    map_task.map(tuples)
    Kevin Kho

    Kevin Kho

    3 months ago
    tuples
    is of type
    List[Tuple]
    . Mapping needs
    Tuple[List]
    . Know what I mean?