PackagesPolicy

Snowflake Documentation

A Packages Policy defines a set of rules for allowed and blocked packages that are applied to user-defined functions and stored procedures.

Examples

Python

packages_policy = PackagesPolicy(
    name="some_packages_policy",
    allowlist=["numpy", "pandas"],
    blocklist=["os", "sys"],
    comment="Policy for data processing packages."
)

YAML

packages_policy:
  - name: some_packages_policy
    allowlist:
      - numpy
      - pandas
    blocklist:
      - os
      - sys
    comment: Policy for data processing packages.

Fields

  • name (string, required) - The name of the packages policy.

  • language (string or Language) - The programming language for the packages. Defaults to PYTHON.

  • allowlist (list) - A list of package specifications that are explicitly allowed.

  • blocklist (list) - A list of package specifications that are explicitly blocked.

  • additional_creation_blocklist (list) - A list of package specifications that are blocked during creation.

  • comment (string) - A comment or description for the packages policy.

  • owner (string or Role) - The owner role of the packages policy. Defaults to SYSADMIN.

Last updated