Quick question regarding *Prefect 2.0 subflow + Da...
# prefect-community
c
Quick question regarding *Prefect 2.0 subflow + DaskTaskRunner*… I currently have a simple ETL flow that I define and can run sequentially no problem. I now want to use this flow in inside another flow that basically wraps and executes it for many files in parallel on a DaskTaskRunner… I know that I have to use my_task.submit() on individual tasks if I want to run them concurrently on a dask cluster. But is it possible to tell a subflow that all it’s tasks should be scheduled with a submit() after the fact? Hope this was not to confusing… Thanks y’all
1
a
You need to be explicit about which tasks get submitted to a task runner - this is why
.submit()
must be called explicitly as always, there are tradeoffs, but we believe this explicit way of submitting tasks to a task runner is easier and less confusing for concurrent execution, you can also use mapping - all mapped tasks will automatically be submitted to the task runner
Copy code
# .map() returns a list of Futures
    mapped_future = add_one.map(
        [1, 2, 3]
    )
c
Thanks for the clarification. Makes sense… Another thing I was pondering is: is it possible to past status messages to Mattermost - same as it’s possible with Slack? We do have a Mattermost system running already at work… Cheers,
a
would you want to contribute that as a Notification? if you're not comfortable with contributing, I could add it as a feature request to the backlog
c
I could have a look… haven’t really looked at the codebase yet. I figure the slack notification is using the slack_api module? Any points on how to get started with something like this or should I simply try to replicate the
prefect slack notification
?
a
Yes 100%, Slack notification would be a great starting point
👍 1
c
I just learned that Mattermost auto-converts incoming slack webhooks to it’s own API 😄 No need for a dedicated package for simple notifications. Simply pass a Mattermost webhook as the URL…
a
Oh nice! Would you be open to share a GitHub markdown file, Discourse topic or even a Google Doc showing how you solved it? I'm sure others would appreciate it
c
Sure. I’m still investigating. Apparently markdown is supposed to be autodetected in the message text but this is not working for me. Maybe I still need to write a dedicated component. Hope to check this out further later this week… busy times
By the way. Is the slack notification text capable to render markdown? I’d like to pass a table in my notifications…
a
With markdown file I only meant a form of how you could share your solution 😂 I think Slack has poor markdown support