sensors
Airflow sensor polling Snowflake Task graph completion.
SnowflakeTaskSensor
Bases: BaseSensorOperator
Poll a Snowflake Task graph until it succeeds or fails.
Uses COMPLETE_GRAPH_TASKS for graph-level status — not individual task
status. Always runs in mode='reschedule' to free the Airflow worker
between polls (see ADR-0002).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_fqn
|
str
|
Fully-qualified Snowflake root Task name ( |
required |
snowflake_conn_id
|
str
|
Airflow connection ID for the Snowflake hook. |
'snowflake_default'
|
**kwargs
|
Any
|
Passed through to |
{}
|
Raises:
| Type | Description |
|---|---|
Exception
|
If the graph reaches state |
Example
from pinky_airflow import SnowflakeTaskOperator, SnowflakeTaskSensor
run = SnowflakeTaskOperator(task_id="run_pipeline", task_fqn="DB.SCHEMA.DAG")
wait = SnowflakeTaskSensor(task_id="wait_pipeline", task_fqn="DB.SCHEMA.DAG")
run >> wait
Source code in src/pinky_airflow/sensors.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
poke(context)
Return True when the graph has completed successfully.
Source code in src/pinky_airflow/sensors.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |