Set up Snowpark for Python with Hex in 3 Easy Steps

Hex: The Snowpark for Python Easy Button

With packages to install and environments to configure, the road to getting started with Snowpark can be time consuming and technically complex. With the great power of Python also comes great responsibility frustration.

Hex sidesteps this by auto-magically installing the Snowpark API in any project connected to Snowflake, making it the easiest way to get started with Snowpark for Python. There’s no worrying about hosting a notebook, configuring environment variables, or downloading anything locally.

Snowpark + Hex

  1. Start a free trial of Hex and establish a data connection with Snowflake and flip the “Enable Snowpark” toggle. You can also leverage Partner Connect to create a free trial of Hex with a pre-configured data connection, straight from the Snowflake console. Hex’s data connections are extremely secure and reusable across the entire organization, so you only need to enter credentials once.

2. Create a new project and set the compute profile to “Snowpark (Python 3.8)”.

3. Open the Snowflake connection in the schema browser and click “Get Snowpark session”, which will automatically insert a Python cell and the required code to create a Snowpark session. All Snowpark package dependencies are already installed, so all you have to do is hit “Run”.

💡 This example uses hextoolkit, a special python package usable only from Hex Python projects. It supports programmatic access to data connections and (in the future) other Hex functionality.

Prefer prototyping in SQL? As always, Hex supports a polyglot workflow for Snowpark. You can return the results of any Snowflake SQL cell into a Snowpark DataFrame.

To learn more about Hex + Snowflake, head over to the Hex blog.

--

--