Using Snowpark in Snowflake CLI¶
Note
Starting with version 3.0.0, Snowflake REST APIs requires Python version 3.10 or higher.
The Snowpark API provides an intuitive library for querying and processing data at scale in Snowflake, without using SQL. Using a library for any of three languages, you can build applications that process data in Snowflake—without moving data to the system where your application code runs—and process at scale as part of the elastic and serverless Snowflake engine.
Snowflake CLI gives developers convenient tooling for developing and managing their Snowpark functions and procedures. To create and maintain Snowpark functions and procedures, use the following process:
Initialize — create a boilerplate
The
snow init <project-name>
command creates a boilerplate project that you can customize.Create — create a project definition
You edit the
snowflake.yml
file with the project details.Build — create artifacts
The
snow snowpark build
command builds the Snowpark project as a.zip
archive that can be used by thesnow snowpark deploy
command. The archive is built using only thesrc
directory specified in thesnowflake.yml
file.Deploy — create Snowflake objects
The
snow snowpark deploy
command uploads local files to the specified stage and creates procedure and function objects defined in the project.Execute — use deployed procedures and functions
The
snow snowpark execute
command executes deployed procedures and functions.Upload — upload already implemented Snowpark functions, procedures, and custom packages, such as from PyPi, in your projects.
The
snow snowpark package
commands let you reuse existing packages.Manage — manage your Snowpark functions and procedures
The
snow snowpark
andsnow object
commands let you create, list, execute, and delete Snowpark functions and procedures.