You are viewing documentation about an older version (0.1.3). View latest version

snowflake.core.task.dagv1.DAG

class snowflake.core.task.dagv1.DAG(name: str, *, schedule: Cron | timedelta | None = None, warehouse: str | None = None, user_task_managed_initial_warehouse_size: str | None = None, error_integration: str | None = None, comment: str | None = None, allow_overlapping_execution: bool | None = None, user_task_timeout_ms: int | None = None, suspend_task_after_num_failures: int | None = None, local_parameters: Dict[str, Any] | None = None)

Bases: object

A graph of tasks composed of a single root task and additional tasks, organized by their dependencies.

Snowflake doesn’t have a first-class DAG entity, so this is a client-side object representation which manages Task relationship. A root Task and its successors logically form a DAG (Directed Acyclic Graph). Refer to DAG of tasks.

When a DAG is deployed, all child tasks are created in Snowflake. A dummy Task is created as the root. A task’s predecessor is the dummy task if it’s added to the DAG with no other predecessors.

Refer to snowflake.core.task.Task for the details of each property.

Attributes

tasks

Returns a list of tasks this DAG has.

name

Name of the DAG and the dummy root task.

warehouse

Refer to snowflake.core.task.Task.warehouse.

user_task_managed_initial_warehouse_size

Refer to snowflake.core.task.Task.user_task_managed_initial_warehouse_size.

comment

comment of the DAG.

schedule

Schedule of the DAG. Refer to snowflake.core.task.Task.schedule.

error_integration

Refer to snowflake.core.task.Task.error_integration.

allow_overlapping_execution

Refer to snowflake.core.task.Task.allow_overlapping_execution.

user_task_timeout_ms

Refer to snowflake.core.task.Task.user_task_timeout_ms.

suspend_task_after_num_failures

Refer to snowflake.core.task.Task.suspend_task_after_num_failures.

local_parameters

Refer to snowflake.core.task.Task.local_parameters.

Methods

__init__(name: str, *, schedule: Cron | timedelta | None = None, warehouse: str | None = None, user_task_managed_initial_warehouse_size: str | None = None, error_integration: str | None = None, comment: str | None = None, allow_overlapping_execution: bool | None = None, user_task_timeout_ms: int | None = None, suspend_task_after_num_failures: int | None = None, local_parameters: Dict[str, Any] | None = None) None
add_task(task: DAGTask) None

Add a child task to this DAG.

get_task(task_name: str) DAGTask | None

Get a child task from this DAG based on task name.