https://prefect.io logo
#prefect-community
Title
# prefect-community
r

Rainer Schülke

05/24/2022, 1:41 PM
Good afternoon 🙂 I am on Prefect 1.0 and was asking myself - mainly out of curiosity - if it is possible to exclude a specific element while calling .map(), store that element and process it at a later point within the flow? (Not talking about unmapped)
1
a

Anna Geller

05/24/2022, 1:48 PM
You would need to do it as part of your task - e.g. you may store those elements that you want to process later in some DB or KV Store (if you are on Prefect Cloud, we have embedded KV store) and retrieve those later, and pass only those elements to mapping task that you want to process now
r

Rainer Schülke

05/24/2022, 1:51 PM
Thanks for the quick reply Anna 🙂 I will leave it as it is but I definitely have a look at your suggestion.
c

Chris L.

05/24/2022, 1:59 PM
Does this help? https://docs.prefect.io/api/latest/tasks/control_flow.html#filtertask Pass the mapped outputs into FilterTask and deal with the filtered tasks accordingly
👍 1
r

Rainer Schülke

05/24/2022, 2:06 PM
Yeah I saw that earlier, I think it would work like this. Thanks Chris 🙂
👍 1
🙌 1
Works like a charm 😉 Is it only possible to use lambda expressions in the filter_func parameter?
c

Chris L.

05/24/2022, 4:16 PM
It accepts any Callable, so any function should work!
4 Views