Introducing: Snowpark Project Templates

Starting your first — or maybe fifth — project using Snowpark? Good news! Snowflake now has project templates for Python, Scala, and Java. These templates provide all the boilerplate: setup instructions, build files, stubs for UDFs and stored procedures, unit tests, and GitHub Actions workflow files for PR validation and deployment! It’s everything you should need to start developing, testing, and deploying with Snowpark.

Follow this demo to generate a Snowpark project and set up your local environment

Getting Started

Using these templates is a snap. If you’re on GitHub, you can clone the repository directly from the web UI:

Creating a new Snowpark project from the template

This will generate a new repository with a clean git history in your chosen account. In this case, I put it into my personal account:

Generated GitHub repo with a clean git history

Prefer to work from the terminal? You’re in luck! You can use the GitHub CLI to create a new repo from the template:

gh repo create <new-repo-name> --template="Snowflake-Labs/snowpark-python-template" # you can replace "python" with "scala" or "java"

Environment Setup

Once you have the repo created, clone it locally and set the following environment variables with your Snowflake account credentials:

# Linux/MacOS
set SNOWSQL_ACCOUNT=<replace with your account identifer>
set SNOWSQL_USER=<replace with your username>
set SNOWSQL_PWD=<replace with your password>
set SNOWSQL_DATABASE=<replace with your database>
set SNOWSQL_SCHEMA=<replace with your schema>
set SNOWSQL_WAREHOUSE=<replace with your warehouse>

Next, install the dependencies from the build file, whether that be requirements.txt, pom.xml, build.gradle, or build.sbt.

Start Hacking!

From here, you’re set up and ready to start developing UDFs and stored procedures using Snowpark. Refer to your templates’ README.md for guidance specific to your programming language.

https://github.com/Snowflake-Labs/snowpark-python-template
https://github.com/Snowflake-Labs/snowpark-scala-template
https://github.com/Snowflake-Labs/snowpark-java-template

If you have a question or run into an issue, comment here or file an issue on the repo. If you have a recommendation for the templates, file a pull request and we’ll take a look!

--

--