Airflow Summit 2026 is coming August 31 - September 2 in Austin, TX. Register now to secure your spot!

airflow.providers.snowflake.operators.snowpark_containers

Attributes

TERMINAL_STATUSES

NON_TERMINAL_STATUSES

Classes

SnowparkContainerJobStatus

Statuses of a Snowpark Container Services.

SnowparkContainerJobOperator

Execute a job on Snowpark Container Services.

Module Contents

class airflow.providers.snowflake.operators.snowpark_containers.SnowparkContainerJobStatus[source]

Bases: str, enum.Enum

Statuses of a Snowpark Container Services.

PENDING = 'PENDING'[source]
RUNNING = 'RUNNING'[source]
CANCELLING = 'CANCELLING'[source]
SUSPENDING = 'SUSPENDING'[source]
DELETING = 'DELETING'[source]
DONE = 'DONE'[source]
FAILED = 'FAILED'[source]
CANCELLED = 'CANCELLED'[source]
INTERNAL_ERROR = 'INTERNAL_ERROR'[source]
airflow.providers.snowflake.operators.snowpark_containers.TERMINAL_STATUSES: frozenset[SnowparkContainerJobStatus][source]
airflow.providers.snowflake.operators.snowpark_containers.NON_TERMINAL_STATUSES: frozenset[SnowparkContainerJobStatus][source]
class airflow.providers.snowflake.operators.snowpark_containers.SnowparkContainerJobOperator(*, compute_pool, container_name, spec=None, spec_stage=None, spec_text=None, name=None, query_warehouse=None, replicas=1, wait_for_completion=True, drop_on_completion=True, poll_interval=10, snowflake_conn_id='snowflake_default', database=None, schema=None, role=None, warehouse=None, **kwargs)[source]

Bases: airflow.providers.common.compat.standard.operators.BaseOperator

Execute a job on Snowpark Container Services.

Submits a container job to a compute pool via EXECUTE JOB SERVICE, optionally polls for completion, retrieves container logs, and drops the job service on success.

Parameters:
  • compute_pool (str) – name of the compute pool to run the job on

  • container_name (str) – container name as defined in the service specification file, used for retrieving container logs

  • spec (str | None) – spec filename on the stage (e.g. 'spec.yaml'). Must be provided together with spec_stage

  • spec_stage (str | None) – stage where the spec file is stored (e.g. '@my_stage'). Must be provided together with spec

  • spec_text (str | None) – inline YAML spec text, as an alternative to spec/spec_stage. The text is wrapped in $$ delimiters automatically

  • name (str | None) – (Optional) job service name. If not provided, Snowflake auto-generates a name

  • query_warehouse (str | None) – (Optional) warehouse for SQL queries run inside the container. This is separate from the warehouse parameter used by the operator’s own SQL commands

  • replicas (int) – (Optional) number of job replicas to run. (default value: 1)

  • wait_for_completion (bool) – poll until the job reaches a terminal state. When disabled, the job is submitted and the operator returns immediately. (default value: True)

  • drop_on_completion (bool) – drop the job service after the job finishes successfully. Failed jobs are not dropped, allowing inspection in Snowflake. (default value: True)

  • poll_interval (int) – the interval in seconds to poll the query status. (default value: 10)

  • snowflake_conn_id (str) – Reference to Snowflake connection id

  • database (str | None) – name of database (will overwrite database defined in connection)

  • schema (str | None) – name of schema (will overwrite schema defined in connection)

  • role (str | None) – name of role (will overwrite any role defined in connection’s extra JSON)

  • warehouse (str | None) – name of warehouse (will overwrite any warehouse defined in the connection’s extra JSON). Used for the operator’s own SQL commands, not for the container’s queries

template_fields: collections.abc.Sequence[str] = ('compute_pool', 'spec', 'spec_stage', 'container_name', 'spec_text', 'name', 'query_warehouse',...[source]
compute_pool[source]
container_name[source]
spec = None[source]
spec_stage = None[source]
spec_text = None[source]
name = None[source]
query_warehouse = None[source]
replicas = 1[source]
wait_for_completion = True[source]
drop_on_completion = True[source]
poll_interval = 10[source]
snowflake_conn_id = 'snowflake_default'[source]
database = None[source]
schema = None[source]
role = None[source]
warehouse = None[source]
job_name: str | None = None[source]
on_kill()[source]

Drop the running service on task kill.

execute(context)[source]

Submit and optionally wait for a Snowpark Container Services job.

Was this entry helpful?