Hi all, I am trying to create a pipeline with a so...
# ask-community
r
Hi all, I am trying to create a pipeline with a solid that receives a dynamic and regular output. Is this possible with the
map() collect()
system? I am thinking of a flow like the following (I know this isnt how map works, just trying to get the point across):
Copy code
dynamic_out = get_values() # returns a dynamicOutput
val = get_some_value() # returns an Output
incrimented = incriment(dynamic_out.map(), val)
a
There should be a better example of this in the docs. Here is the approach I think you are looking for
Copy code
dynamic_out = get_values() # returns a dynamicOutput
val = get_some_value() # returns an Output
incrimented = dynamic_out.map(lambda dynamic_val: incriment(dynamic_val, val))
or
Copy code
dynamic_out = get_values() # returns a dynamicOutput
val = get_some_value() # returns an Output

def _for_each(dynamic_val):
    incriment(dynamic_val, val)

incrimented = dynamic_out.map(_for_each)
r
Ah, great. This should work. Ill PR an example to the doc when I have time. Is there any discussion on updating the dynamic output syntax? I can see this sort of syntax becoming cumbersome once multiple dynamic outputs are supported. Something like:
Copy code
incrimented = incriment(dynamic_out, val)
would be great. or for better readability:
Copy code
incrimented = incriment(dynamic_out.map(), val)
s
This helped me a ton, thank @Ricardo Azevedo and @alex!! Definitely would be very helpful in the docs.
❤️ 1