0% found this document useful (0 votes)
233 views1 page

Writing Snowpark Code in Python Worksheets - Snowflake Documentation

The document discusses writing Snowpark code in Python worksheets in Snowflake to process data without needing to install dependent libraries. It describes preparing roles and packages in Snowflake, setting up a worksheet, writing Snowpark code in the worksheet, and running it to transform and store data without leaving Snowflake.

Uploaded by

demorepo99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
233 views1 page

Writing Snowpark Code in Python Worksheets - Snowflake Documentation

The document discusses writing Snowpark code in Python worksheets in Snowflake to process data without needing to install dependent libraries. It describes preparing roles and packages in Snowflake, setting up a worksheet, writing Snowpark code in the worksheet, and running it to transform and store data without leaving Snowflake.

Uploaded by

demorepo99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

4/29/24, 3:05 PM Writing Snowpark Code in Python Worksheets | Snowflake Documentation

Developer Snowpark API Python Writing Snowpark Code in Python Worksheets


Writing Snowpark Code in Python
Worksheets
Write Snowpark code in Python worksheets to process data using Snowpark
Python in Snowsight. By writing code in Python worksheets, you can perform your
development and testing in Snowflake without needing to install dependent
libraries.
To develop with Python worksheets, do the following:
1. Prepare roles and packages in Snowflake.
2. Set up your worksheet for development.
3. Write Snowpark code in your Python worksheet.
4. Run your Python worksheet.
For example, you might write code in a Python worksheet that extracts data from
stages or database objects in Snowflake, transforms the data, and stores the
transformed data in Snowflake. You could then deploy that code as a stored
procedure and build a data pipeline, all without leaving Snowflake.
About Python Worksheets
Python worksheets let you use Snowpark Python in Snowsight to perform data
manipulations and transformations. You can use third-party packages listed in the
Snowflake Anaconda channel or import your own Python files from stages to use in
scripts.
After running a Python worksheet, review the results and output returned by your
script. The results display as a string, variant, or a table, depending on your code.
See Running Python Worksheets.
Note
Because Python worksheets run inside Snowflake rather than in your local
development environment, you cannot use session.add_import to add a file
that your Python code depends on, or session.add_packages or
session.add_requirements to add packages that you need to use in your
Python code. Instead, you add those files to a stage and reference them in
your code. See Staging files using Snowsight.
https://docs.snowflake.com/en/developer-guide/snowpark/python/python-worksheets 1/1

You might also like