This document describes the function of tasks inside the Seaplane platform and how to use them.
Tasks are the building blocks inside Seaplane applications and are defined
@task decorator. Each task should have an
id and a
is an example definition of a standard
from seaplane import task
# run your task code here
The data object inside the function definition holds a JSON object that is retrieved from the previous step in your pipeline (DAG).
There are various different types of tasks available such as compute and inference tasks. You can learn more about the different task types here.
You can add one or multiple resources to a task. Resources are added inside the
@task decorator. For example, the code snippet below adds a SQL database
resource to the compute task. You can learn more about all available resources
and how to use them here.
from seaplane import task, sql
@task(id='my-task-id', type='compute', sql_db=['username', 'password', 'db-name'])
def my_task(data, sql_db):
sql_db.excute("select * from my_table where ...")