Skip to content

dag

Dag

Bases: BaseResource

Meta-resource that generates a Snowflake Task DAG from a list of task descriptors.

Produces the full DAG topology: ROOT_TASK_WRAPPER (finalizer + notification) and TASK_WRAPPER (per-step SP caller with SKIP cascade). Never maps 1:1 to a single Snowflake object — see explanation/dag.md for the generated structure.

Attributes:

Name Type Description
tasks list[dict[str, Any]]

Ordered list of task descriptors (each maps to one TASK_WRAPPER).

trigger str

Trigger mode — CRON, CONDITIONAL_CRON, or STREAM.

alerts_to str | None

Notification target on technical failure.

contact_to str | None

Notification target on business rejection.

Source code in src/pinky_provider/dag/dag.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class Dag(BaseResource):
    """Meta-resource that generates a Snowflake Task DAG from a list of task descriptors.

    Produces the full DAG topology: ``ROOT_TASK_WRAPPER`` (finalizer + notification)
    and ``TASK_WRAPPER`` (per-step SP caller with SKIP cascade). Never maps 1:1 to
    a single Snowflake object — see ``explanation/dag.md`` for the generated structure.

    Attributes:
        tasks: Ordered list of task descriptors (each maps to one ``TASK_WRAPPER``).
        trigger: Trigger mode — ``CRON``, ``CONDITIONAL_CRON``, or ``STREAM``.
        alerts_to: Notification target on technical failure.
        contact_to: Notification target on business rejection.
    """

    tasks: list[dict[str, Any]] = Field(default_factory=list)
    trigger: str = "CRON"
    alerts_to: str | None = None
    contact_to: str | None = None