Create Snowflake Notebooks¶
This topic describes how to create Snowflake Notebooks. You can access Snowflake Notebooks through Snowsight. You can create a notebook with the following methods:
Tip
You can also create a notebook using SQL. See CREATE NOTEBOOK.
Prerequisites¶
Follow the setup instructions to enable notebooks.
You are using a role with the required privileges.
Create a new notebook¶
To create a Snowflake notebook, follow these steps:
Sign in to Snowsight.
Select Projects » Notebooks in the left-side navigation menu.
Select + Notebook.
Enter a name for your notebook.
Select a Notebook location. This is the database and schema in which to store your notebook. These cannot be changed after you create the notebook.
Note
The Notebook location dropdown may not show databases created after the Create Notebook dialog is opened. If you cannot find your recently created database, schema, or warehouse, try reloading your browser window.
(Optional) Select a Query warehouse to run any SQL and Snowpark queries issued by the notebook. For guidance on what size warehouse to use, see Warehouse recommendations for running Snowflake Notebooks.
Select a Notebook warehouse to run notebook-specific tasks. Snowflake recommends that you use SYSTEM$STREAMLIT_NOTEBOOK_WH, a Snowflake-managed warehouse that is provisioned in each account for running notebooks. For details, see Default warehouse for Notebooks.
(Optional) To save the current selections for future notebooks, select the Remember these settings check box.
Select Create to create and open your notebook.
For information about adding cells, see Develop and run code in Snowflake Notebooks.
Create Snowflake Notebooks from an existing file¶
You can create a notebook in Snowflake by importing a file with the *.ipynb
extension. This could be a notebook file that has been
created from an application outside of Snowflake.
Sign in to Snowsight.
Select Projects » Notebooks.
Next to + Notebook, open the drop-down menu and select Import .ipynb file.
Using the file browser, browse to and open the file that you want to import.
Enter a name for your notebook.
Select a Notebook location. This is the database and schema in which to store your notebook. These cannot be changed after you create the notebook.
(Optional) Change the selected warehouse to use to run your notebook.
For guidance on what size warehouse to use, see Warehouse recommendations for running Snowflake Notebooks.
Select Create to create and open your notebook.
Note
If your notebook imports Python packages, you must add the packages to the notebook before you can run the imported notebook. See Import Python packages to use in notebooks. If the package you use in your imported notebook is not available, your code might not run.
For information about adding cells, see Develop and run code in Snowflake Notebooks.
Create a notebook from a Git repository¶
You can sync your notebook development with a Git repository. Then you can create Snowflake Notebooks from notebooks in that Git repository.
To create a notebook from a file in Git, see Create a notebook from a file in a Git repository.
Duplicate an existing notebook¶
You can duplicate existing Snowflake Notebooks. Duplicating notebooks may be useful if you want to, for example, test out some code changes without altering the original notebook version.
When you duplicate a notebook, the copied notebook is created with the same role and warehouse as the original notebook, and is contained in the same database and schema as the original notebook. Because of this, you cannot duplicate a notebook to move it to a different database and schema, or to change ownership.
To duplicate a notebook, complete the following steps:
Sign in to Snowsight.
Select Projects » Notebooks.
Open the notebook that you want to duplicate.
Select the vertical ellipsis menu, and then select Duplicate.
(Optional) enter a name for the duplicate notebook, and then select Duplicate.
The duplicate notebook is created.
In the confirmation dialog, select Close to return to the original notebook, or Open notebook to open the duplicate notebook.
Open an existing notebook¶
To open an existing notebook, follow these steps:
Sign in to Snowsight.
Select Notebooks.
Review the list of notebooks.
You can see all notebooks owned by your active role or owned by a role inherited by your active role.
Select a notebook to open it for editing.
For details about editing notebooks, see Develop and run code in Snowflake Notebooks.
When you open a notebook, you can see cached results from the last time you ran any cells in the notebook. The notebook is in the Not connected state by default, but if you select that state or run any cell, your notebook connects to your virtual warehouse.