Snowflake Snowpark

Emanuel Zgraggen - January 4th, 2023

Snowpark allows developers to use familiar languages and coding styles (e.g, Python, Pandas, etc.) to create and run machine learning, data science and complex data transformation workflows directly on Snowflake compute without having to transfer data to an external environment. Depending on the size of your data, this can speed up certain workloads dramatically. While many languages are supported, most interesting for us is the Python API.

Snowpark only works for Python 3.8. In Einblick you can switch Python versions easily and we can install the Snowpark library through the "Init cell".

The following Einblick canvas here shows a simple example of how to query data and do basic data exploration through Snowpark's Python API. However, much more advanced examples can be implemented through the same process.

If you fork the canvas, don't forget to update your Snowflake credentials in the secrets tab.

from snowflake.snowpark.session import Session

accountname = getpass.getpass()
username = getpass.getpass()
password = getpass.getpass()

connection_parameters = {
    "account": accountname,
    "user": username,
    "password": password,
    "role": "ACCOUNTADMIN",
    "database": "EINBLICK",
    "schema": "PUBLIC",
    "warehouse": "COMPUTE_WH"
session = Session.builder.configs(connection_parameters).create()

snowpark_df = session.table('SALES_EXPORT_JUNE')
pandas_df2 = snowpark_df.to_pandas()

snowpark_df = snowpark_df.group_by(['MARRIED', 'EMPLOYED']).agg([F.avg('AGE').as_('AVG_AGE')])


Einblick is an AI-native data science platform that provides data teams with an agile workflow to swiftly explore data, build predictive models, and deploy data apps. Founded in 2020, Einblick was developed based on six years of research at MIT and Brown University. Einblick is funded by Amplify Partners, Flybridge, Samsung Next, Dell Technologies Capital, and Intel Capital. For more information, please visit and follow us on LinkedIn and Twitter.

Start using Einblick

Pull all your data sources together, and build actionable insights on a single unified platform.

  • All connectors
  • Unlimited teammates
  • All operators