Jerry Thomas
08/22/2019, 4:49 AMpython
@task
def convert(data, value):
data['x'] *= value
return data
data = [{"x": x, "y": x % 5, "z": x % 3} for x in range(10)]
with Flow("convert-using-value") as flow:
res = convert.map(data, [2 for i in range(10)])
However, it there a better way to say mark the value parameter to be shared across multiple executions for a call.Jeremiah
08/22/2019, 1:07 PMunmapped
operator for exactly this situation. Here are the [relevant docs](https://docs.prefect.io/guide/core_concepts/mapping.html#unmapped-inputs). I think you’ll simply need to call value=unmapped([2 for i in range(10)])
.Jerry Thomas
08/23/2019, 6:37 AM