Snowsight Workspaces & Notebooks
Snowflake · Snowflake Fundamentals
Theory
Workspaces is Snowsight's file-based editor for SQL and Python, opened from Projects → Workspaces. It replaced the legacy Worksheets: instead of loose worksheets you keep files such as load_orders.sql in folders, set the role, warehouse and database context from the editor, and a workspace can be connected to a Git repository so the same files are versioned and reviewed like any other code.
Notebooks in Workspaces are Jupyter-compatible notebooks with Python, SQL and Markdown cells. Their Python kernel runs on the Container Runtime, a Snowflake-managed notebook service on a compute pool node, while SQL and Snowpark queries still run on a warehouse. For example, a SQL cell can pull last month's orders and the next Python cell can chart them. The original notebooks are now called Legacy Notebooks.
Why we use it
Analysts and engineers need one place to write, organise and version SQL and Python next to the data. Files, folders and Git make work reviewable and reusable, and notebooks mix queries, code and explanation without exporting data to a laptop.
When to use it
Use workspace SQL files for queries, DDL and scripts you will rerun; use a notebook for exploration, data science and step-by-step analysis. Use Snowflake CLI or a scheduler for unattended automation, and suspend idle notebook services to stop their compute cost.
How it works
- Projects → Workspaces
- Is it a script you will rerun or deploy? Yes: Create a SQL file and set role and warehouse. No: Create a notebook.
- Write the code and run it (Ctrl+Enter runs the current statement)
- Is the notebook's Python service running? Yes: Run Python cells on the compute pool node. No: Connect to start a notebook service.
- SQL and Snowpark queries run on the chosen warehouse
- Save, commit to Git or share the file
Example
-- In a workspace SQL file (Projects → Workspaces → + Add new → SQL File)
USE ROLE sysadmin;
USE WAREHOUSE compute_wh;
SELECT region, SUM(amount) AS total_sales
FROM sales_db.public.orders
GROUP BY region
ORDER BY total_sales DESC;
-- See notebook services that are using compute pool nodes
SHOW SERVICES OF TYPE NOTEBOOK;Key points
- Workspaces replaced the legacy Worksheets editor
- Files and folders can be connected to a Git repository
- Pick role, warehouse and database from the context selector above the editor
- Notebook Python runs on the Container Runtime; SQL runs on a warehouse
- Notebook services bill while running; suspend them when idle
- SHOW SERVICES OF TYPE NOTEBOOK lists running notebook services