Embedding and running custom functions in a clean room

You can upload and run custom Python code in a clean room. This is useful for performing complex data transformations, analytics, or machine learning tasks that aren’t possible with standard SQL queries. Your code can take advantage of a standard bundle of Python packages (https://repo.anaconda.com/pkgs/snowflake/) and the Snowpark API. Python is the only coding language supported by clean rooms.

Templates in a clean room can call uploaded code, but a template can call only code that is uploaded by the same account that added the template. Uploaded code can’t be viewed or downloaded. Snowflake scans uploaded code for security issues.

There are different mechanisms for uploading code into a clean room, depending on your role:

Providers

  • Inline code upload: If you want to upload code using the default compute resources for a clean room, and need to use only the standard bundle of Python packages (including the Snowpark API), you should upload inline code.

  • Snowpark Container Services running within a clean room: If you need more control over the environment, such as specifying additional compute or custom libraries, you can run a Snowpark Container within a clean room.

Consumers

  • Inline upload with template.: Consumers can upload and run a template bundled with code. The code is bound to the template, and must be approved by the clean room provider.

Language: English