snowflake.core.code_bundle.BundleSpec

class snowflake.core.code_bundle.BundleSpec(*, type: Annotated[str, Strict(strict=True)], compute_type: Annotated[str, Strict(strict=True)], language: Annotated[str, Strict(strict=True)] | None = None, compute_options: Dict[str, Any] | None = None, properties: Dict[str, Any] | None = None, artifact_repositories: List[Annotated[str, Strict(strict=True)]] | None = None, stage_mounts: Dict[str, StageMount] | None = None, secrets: List[Annotated[str, Strict(strict=True)]] | None = None, external_access_integrations: List[Annotated[str, Strict(strict=True)]] | None = None, env_vars: List[Dict[str, Annotated[str, Strict(strict=True)]]] | None = None, telemetry_options: Dict[str, Any] | None = None)

Bases: BaseModel

A model object representing the BundleSpec resource.

Constructs an object of type BundleSpec with the provided properties.

Parameters:
  • type (str) – Bundle type: custom | spark | ml.

  • compute_type (str) – Compute environment: warehouse | compute_pool | serverless.

  • language (str, optional) – Language: python | java | scala. Required when type is custom.

  • compute_options (object, optional) – compute_type-specific options. For warehouse: warehouse and runtime_version. For compute_pool: compute_pool, query_warehouse, and runtime_version.

  • properties (object, optional) – type-specific property bag. For example, for python: requirements_file or python_packages.

  • artifact_repositories (list[str], optional) – Fully qualified artifact repositories (database.schema.object_name) to install packages from. Warehouse execution supports at most one entry. Defaults to snowflake.snowpark.pypi_shared_repository when omitted.

  • stage_mounts (StageMount, optional) – Stage mounts keyed by mount name; each value describes a stage path mounted at a container path.

  • secrets (list[str], optional) – Snowflake secret objects (database.schema.secret_object_name) to attach at runtime.

  • external_access_integrations (list[str], optional) – External access integration objects (database.schema.eai_object_name) to attach at execution time.

  • env_vars (list[Dict[str, str]], optional) – List of single-key maps, each mapping an environment variable name to its value.

  • telemetry_options (object, optional) – Telemetry options as a name/value map (for example, log_level and trace_level).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Methods

classmethod from_dict(obj: dict) BundleSpec

Create an instance of BundleSpec from a dict.

classmethod from_json(json_str: str) BundleSpec

Create an instance of BundleSpec from a JSON string.

to_dict(hide_readonly_properties: bool = False) dict[str, Any]

Returns the dictionary representation of the model using alias.

to_dict_without_readonly_properties() dict[str, Any]

Return the dictionary representation of the model without readonly properties.

to_json() str

Returns the JSON representation of the model using alias.

to_str() str

Returns the string representation of the model using alias.