Tutorial: Testing Python Snowpark

Introduction

This tutorial introduces the basics of testing your Snowpark Python code.

What You Will Learn

In this tutorial, you will learn how to:

  • Test your Snowpark code while connected to Snowflake.

    You can use standard testing utilities, like PyTest, to test your Snowpark Python UDFs, DataFrame transformations, and stored procedures.

  • Test your Snowpark Python DataFrames locally without connecting to a Snowflake account by using the local testing framework.

    You can use the local testing framework to test locally, on your development machine, before deploying code changes.

Prerequisites

To use the local testing framework:

  • You must use version 1.11.1 or higher of the Snowpark Python library.

  • The supported versions of Python are:

    • 3.9

    • 3.10

    • 3.11

    • 3.12