liveBook · Manning

Python worksheet

As explained in Snowflake Data Engineering

A Python worksheet is a Snowflake development interface for writing and executing Python code in a worksheet context.

A Python worksheet is a Snowsight development interface for writing, configuring, executing, and deploying Snowpark Python code in Snowflake. Configure the worksheet with a role, warehouse, database, schema, handler, return type, and required packages before running the code. section 6.2 section 6.8

A practical worksheet workflow includes:

  • Select SYSADMIN, a virtual warehouse, database, and schema for the worksheet context. section 6.2
  • Set the handler and return type, remembering that Boolean results must be returned as strings. section 6.2
  • Use a meaningful worksheet name and organize multiple worksheets in folders. section 6.2

Holiday-checking procedure

Configure a Python worksheet around an IS_HOLIDAY handler, select the holidays package, and check whether a date belongs to a country’s holiday calendar. The procedure can be called with dates and countries such as US and FR to return True or False.

How Snowflake Data Engineering covers it

How deep it goes
Configures execution context, handlers, return types, and packages, then contrasts worksheets with source-controlled local development.
Examples
Uses an IS_HOLIDAY function, the holidays package, and country-specific date checks.
What it assumes
Assumes access to Snowsight, a role, warehouse, database, and schema while introducing Snowpark worksheet setup explicitly.
What you can do after
Operate/configure a Snowpark Python handler, select dependencies, execute it in Snowflake, and call the resulting procedure.
How it connects
Connects Snowpark sessions, Python functions, stored procedures, packages, and secure server-side execution.

This explainer was generated by Manning's knowledge graph from the text of Snowflake Data Engineering. The section links point to the parts of the book it draws on.