Skip to content

Commit 9185bc9

Browse files
Snowflake docs review (#1202)
1 parent 28e75b3 commit 9185bc9

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

content/deploy/snowflake/_index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Host your apps alongside your data in a single, global platform. Snowflake provi
1818
<Tile
1919
icon="code"
2020
title="Examples"
21-
text="Explore a plethora of example apps in Snowflake Labs' snowflake-demo-streamlit repository."
21+
text="Explore a wide variety of example apps in Snowflake Labs' snowflake-demo-streamlit repository."
2222
link="https://github.com/Snowflake-Labs/snowflake-demo-streamlit"
2323
background="lightBlue-70"
2424
/>
@@ -31,27 +31,27 @@ Host your apps alongside your data in a single, global platform. Snowflake provi
3131
/>
3232
</TileContainer>
3333

34-
There are three ways to host Streamlit apps in Snowflake.
34+
There are three ways to host Streamlit apps in Snowflake:
3535

3636
<InlineCalloutContainer>
3737
<InlineCallout
3838
color="lightBlue-70"
3939
icon="bolt"
4040
bold="Streamlit in Snowflake."
4141
href="https://docs.snowflake.com/developer-guide/streamlit/about-streamlit"
42-
>Run your Streamlit app as a native object in Snowflake. Enjoy an in-browser editor and minimal work to configure your environment. Share your app with other users in your Snowflake account through role-based access control. This is a great way to deploy apps internally for your business. Check out Snowflake docs!</InlineCallout>
42+
>Run your Streamlit app as a native object in Snowflake. Enjoy an in-browser editor and minimal work to configure your environment. Share your app with other users in your Snowflake account through role-based access control (RBAC). This is a great way to deploy apps internally for your business. Check out Snowflake docs!</InlineCallout>
4343
<InlineCallout
4444
color="lightBlue-70"
4545
icon="ac_unit"
4646
bold="Snowflake Native Apps."
4747
href="https://docs.snowflake.com/en/developer-guide/native-apps/adding-streamlit"
48-
>Package your app with data and share it with other Snowflake accounts. This is a great way to share apps and their underlying data with other organizations who use Snowflake so they can run it in their own account. Check out Snowflake docs!</InlineCallout>
48+
>Package your app with data and share it with other Snowflake accounts. This is a great way to share apps and their underlying data with other organizations who use Snowflake. Check out Snowflake docs!</InlineCallout>
4949
<InlineCallout
5050
color="lightBlue-70"
5151
icon="web_asset"
5252
bold="Snowpark Container Services."
5353
href="https://docs.snowflake.com/en/developer-guide/snowpark-container-services/overview"
54-
>Deploy your app in a container that's optimized to run in Snowflake. This is the most flexible option where you can use any library. Share your app publicly or privately. Check out Snowflake docs!</InlineCallout>
54+
>Deploy your app in a container that's optimized to run in Snowflake. This is the most flexible option, where you can use any library and assign a public URL to your app. Manage your allowed viewers through your Snowflake account. Check out Snowflake docs!</InlineCallout>
5555
</InlineCalloutContainer>
5656

5757
<Note>

content/develop/tutorials/databases/snowflake.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ slug: /develop/tutorials/databases/snowflake
77

88
## Introduction
99

10-
This guide explains how to securely access a Snowflake database from Streamlit. It uses [st.connection](/develop/api-reference/connections/st.connection), the [Snowpark library](https://docs.snowflake.com/en/developer-guide/snowpark/python/index) and Streamlit's [Secrets management](/develop/concepts/connections/secrets-management).
10+
This guide explains how to securely access a Snowflake database from Streamlit. It uses [st.connection](/develop/api-reference/connections/st.connection), the [Snowpark library](https://docs.snowflake.com/en/developer-guide/snowpark/python/index), and Streamlit's [Secrets management](/develop/concepts/connections/secrets-management).
1111

1212
### Prerequisites
1313

@@ -20,7 +20,7 @@ This guide explains how to securely access a Snowflake database from Streamlit.
2020
```
2121

2222
<Note>
23-
Use the correct version of Python required by `snowflake-snowpark-python`. For example, if you use `snowflake-snowpark-python==1.23.0` you must use Python version \>=3.8, \<3.12.
23+
Use the correct version of Python required by `snowflake-snowpark-python`. For example, if you use `snowflake-snowpark-python==1.23.0`, you must use Python version \>=3.8, \<3.12.
2424
</Note>
2525

2626
- You must have a Snowflake account. To create a trial account, see the [tutorial](/get-started/installation/streamlit-in-snowflake) in _Get started_.
@@ -31,13 +31,13 @@ This guide explains how to securely access a Snowflake database from Streamlit.
3131
If you already have a database that you want to use, you can [skip to the next step](#add-connection-parameters-to-your-local-app-secrets).
3232

3333
1. Sign in to your Snowflake account at [https://app.snowflake.com](https://app.snowflake.com).
34-
1. In the left navigation, click "**Projects**," then click "**Worksheets**."
34+
1. In the left navigation, select "**Projects**," and then select "**Worksheets**."
3535
1. To create a new worksheet, in the upper-right corner, click the plus icon (<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>add</i>).
3636

3737
You can use a worksheet to quickly and conveniently execute SQL statements. This is a great way to learn about and experiment with SQL in a trial account.
3838

39-
1. Optional: To rename your worksheet, in the upper-left corner, hover over the tab with your worksheet name, and click the overflow menu icon (<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>more_vert</i>). Select "**Rename**", enter a new worksheet name (e.g. "Scratchwork"), and press "**Enter**".
40-
1. To create a new database with a table, in your worksheet's SQL editor, type the following SQL statements, and execute them.
39+
1. Optional: To rename your worksheet, in the upper-left corner, hover over the tab with your worksheet name, and then click the overflow menu icon (<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>more_vert</i>). Select "**Rename**", enter a new worksheet name (e.g. "Scratchwork"), and then press "**Enter**".
40+
1. To create a new database with a table, in your worksheet's SQL editor, type and execute the following SQL statements:
4141

4242
```sql
4343
CREATE DATABASE PETS;
@@ -56,7 +56,7 @@ If you already have a database that you want to use, you can [skip to the next s
5656

5757
<Important>
5858

59-
If no lines are highlighted and you click the play button, only the line with your cursor will execute.
59+
If no lines are highlighted and you click the play button, only the line with your cursor will be executed.
6060

6161
</Important>
6262

@@ -75,11 +75,11 @@ If you already have a database that you want to use, you can [skip to the next s
7575

7676
Because the SQL statements did not specify a schema, they defaulted to the "PUBLIC" schema within the new "PETS" database. The role and warehouse are trial-account defaults. You can see the role and warehouse used by your worksheet in the upper-right corner, to the left of the "**Share**" and play (<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>play_arrow</i>) buttons.
7777

78-
In Snowflake, databases provide storage and warehouses provide compute. When you configure your connection, you aren't explicitly required to declare role, warehouse, database, and schema; if these are not specified, the connection will use your account defaults. You can also change these settings within an active connection if you need to use multiple roles, warehouses, or databases. However, declaring these defaults avoids unintentional selections.
78+
In Snowflake, databases provide storage, and warehouses provide compute. When you configure your connection, you aren't explicitly required to declare role, warehouse, database, and schema; if these are not specified, the connection will use your account defaults. If you want to use multiple roles, warehouses, or databases, you can also change these settings within an active connection. However, declaring these defaults avoids unintentional selections.
7979

8080
1. To conveniently copy your account identifier, in the lower-left corner, click your profile image, and hover over your account. A popover dialog expands to the right with your organization and account. In the popover, hover over your account, and click the copy icon (<i style={{ verticalAlign: "-.25em", transform: "rotateZ(90deg)" }} className={{ class: "material-icons-sharp" }}>content_copy</i>).
8181

82-
The account identifier in your clipboard is period-separated, which is the format used for SQL statements. Paste your account identifier into your notes, and change the period into a hyphen. The Snowflake Connector for Python requires the hyphen-separated format for your account identifier.
82+
The account identifier in your clipboard is period-separated, which is the format used for SQL statements. However, the Snowflake Connector for Python requires a hyphen-separated format. Paste your account identifier into your notes, and change the period to a hyphen.
8383

8484
```toml
8585
account = "xxxxxxx-xxxxxxx"
@@ -156,7 +156,7 @@ If you already have your connection configured using [Snowflake's connections fi
156156

157157
## Write your Streamlit app
158158

159-
1. Copy the code below to your Streamlit app and save it. If you are not using the example database and table from the first section of this tutorial, replace the SQL query and results handling as desired.
159+
1. Copy the following code to your Streamlit app and save it. If you are not using the example database and table from the first section of this tutorial, replace the SQL query and results handling as appropriate.
160160

161161
```python
162162
# streamlit_app.py
@@ -170,7 +170,7 @@ If you already have your connection configured using [Snowflake's connections fi
170170
st.write(f"{row.NAME} has a :{row.PET}:")
171171
```
172172

173-
The `st.connection` command creates a `SnowflakeConnection` object and handles secrets retrieval. The `.query()` method handles query caching and retries. By default, query results are cached without expiring. Setting `ttl="10m"` ensures the query result is cached for no longer than 10 minutes. To disable caching, you can set `ttl=0` instead. Learn more in [Caching](/develop/concepts/architecture/caching).
173+
The `st.connection` command creates a `SnowflakeConnection` object and handles secrets retrieval. The `.query()` method handles query caching and retries. By default, query results are cached without expiring. Setting `ttl="10m"` ensures that the query result is cached for no longer than 10 minutes. To disable caching, you can set `ttl=0` instead. Learn more in [Caching](/develop/concepts/architecture/caching).
174174

175175
<Note>
176176

@@ -192,7 +192,7 @@ If you already have your connection configured using [Snowflake's connections fi
192192

193193
![Finished app screenshot](/images/databases/streamlit-app.png)
194194

195-
### Use a Snowpark Session
195+
### Use a Snowpark session
196196

197197
The [SnowflakeConnection](/develop/api-reference/connections/st.connections.snowflakeconnection) used above also provides access to [Snowpark sessions](https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/session.html) for dataframe-style operations that run natively inside Snowflake. Using this approach, you can rewrite the app above as follows:
198198

content/get-started/installation/sis.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ All you need is an email address! Everything else happens in your 30-day trial a
3131
<Image alt="Choose your Snowflake edition, provider, and region" src="/images/get-started/SiS-region.png" />
3232
</div>
3333

34-
1. Answer or skip a few questions to let us know more about yourself.
34+
1. Answer a few questions to let us know more about yourself, or skip them.
3535

3636
1. A message will display: "You're now signed up!" Go to your email, and click on the activation link. (Within your link, note the subdomain. This is your Snowflake account identifier. `https://<account_identifier>.snowflakecomputing.com`)
3737

3838
1. Set your username and password. This will be an admin user account within your Snowflake account. Your Snowflake account can have multiple users within it.
3939

40-
1. If you are not signed in after setting your password, follow the instructions to enter your Snowflake account identifier, then enter your username and password. If you've accidentally closed your browser, you can log in at [app.snowflake.com](https://app.snowflake.com/).
40+
1. If you are not signed in after setting your password, follow the instructions to enter your Snowflake account identifier, and then enter your username and password. If you've accidentally closed your browser, you can sign in at [app.snowflake.com](https://app.snowflake.com/).
4141

4242
Congratulations! You have a trial Snowflake account.
4343

@@ -89,7 +89,7 @@ The databases in the above screenshot are as follows:
8989
- App location: "STREAMLIT_DB" and "PUBLIC"
9090
- App warehouse: "COMPUTE_WH" (default) or "STREAMLIT_WH" (if you created a new warehouse)
9191

92-
If you can't select your database, refresh the page to ensure the interface is displaying current information.
92+
If you can't select your database, refresh the page to ensure that the interface is displaying current information.
9393

9494
1. Click "**Create**." (Note that the app will run with the rights of "ACCOUNTADMIN" for simplicity. You can curate your roles and permissions to choose who can create and access apps.)
9595

@@ -107,7 +107,7 @@ The databases in the above screenshot are as follows:
107107
st.write("Hello World")
108108
```
109109

110-
If you want to get back to the sample code later, you can always make another app to edit the same example again.
110+
If you want to return to the sample code later, you can always make another app to edit the same example again.
111111

112112
1. In the upper-right corner, click the blue "<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>play_arrow</i> **Run**" button to make the running app reflect your changes.
113113

@@ -135,17 +135,17 @@ The databases in the above screenshot are as follows:
135135

136136
1. Optional: Make more edits to your app. You must interact with your app or click the blue "<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>play_arrow</i> **Run**" button to display the changes. This is different from a local environment where you can save your changes to trigger a rerun.
137137

138-
1. To go back to Snowsight, in the upper-left corner, click "<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>chevron_left</i> **Streamlit Apps**."
138+
1. To return to Snowsight, in the upper-left corner, click "<i style={{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>chevron_left</i> **Streamlit Apps**."
139139

140140
## Return to your app
141141

142-
When you want to view or edit your app again, you can return to it through Snowsight. If you are returning to the site, you can log in at [app.snowflake.com](https://app.snowflake.com/).
142+
When you want to view or edit your app again, you can return to it through Snowsight. If you are returning to the site, you can sign in at [app.snowflake.com](https://app.snowflake.com/).
143143

144144
1. In the left navigation, select "**Projects**" → "**Streamlit**."
145145

146146
1. In your list of apps, click "**Hello World**."
147147

148-
If you don't see your app, check that you have your role set to "ACCOUNTADMIN" as described in [Optional: Create a warehouse](/get-started/installation/streamlit-in-snowflake#optional-create-a-warehouse).
148+
If you don't see your app, check that your role is set to "ACCOUNTADMIN" as described in [Optional: Create a warehouse](/get-started/installation/streamlit-in-snowflake#optional-create-a-warehouse).
149149

150150
1. Your app will open in viewing mode. To edit your app, in the upper-right corner, click "**Edit**."
151151

0 commit comments

Comments
 (0)