Skip to content

feat: add notebook to upgrade shared tier #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions notebooks/python-udf-template/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
]
},
{
"id": "bd0ae268",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the ids changing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to run this by @kesmit13, because its one of the pre-commit hooks that changes that. I might be using it wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the messages consistent, the pre-commit checks always remove any cells that mention free tier workspaces and inserts the standardized message. This also comes with a new ID as a side-effect.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other IDs should remain the same as long as they are valid ID values. We've had issues where invalid ID values were being created, so we normalize them. Although looking at the ones below, they appear to be ok.

"id": "537627f1",
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -41,27 +41,26 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "bcb6e6a7",
"metadata": {},
"source": [
"This Jupyter notebook will help you build your first Python UDF using Notebooks, registering it with your database and calling it as part of SQL query."
]
],
"id": "22cf54b0"
},
{
"attachments": {},
"cell_type": "markdown",
"id": "5776ded1",
"metadata": {},
"source": [
"## Create some simple tables\n",
"\n",
"This setup establishes a basic relational structure to store some reviews for restaurants. Ensure you have selected a database."
]
],
"id": "891fb62a"
},
{
"cell_type": "code",
"execution_count": 1,
"id": "2bbf6a44",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -74,7 +73,8 @@
" store_name VARCHAR(255) NOT NULL,\n",
" review TEXT NOT NULL\n",
");"
]
],
"id": "d807ea15"
},
{
"attachments": {},
Expand Down Expand Up @@ -103,13 +103,13 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "d58c8382",
"metadata": {},
"source": [
"## Define Python UDF functions\n",
"\n",
"Next, we will be Python UDF function using the `@udf` annotation. We will be using the `VADER` model of `nltk` library to perform sentiment analysis on the review text."
]
],
"id": "9bc1fbbb"
},
{
"cell_type": "code",
Expand All @@ -124,7 +124,6 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "f3f3b047",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -146,29 +145,30 @@
" )\n",
" print(\"sentiment:\" + sentiment)\n",
" return sentiment"
]
],
"id": "94080c32"
},
{
"attachments": {},
"cell_type": "markdown",
"id": "40e2ad59",
"metadata": {},
"source": [
"## Start the Python UDF server\n",
"\n",
"This will start the server as well as register all the functions annotated with `@udf` as external user defined functions on your selected database."
]
],
"id": "9ef4fb97"
},
{
"cell_type": "code",
"execution_count": 5,
"id": "ed4b22cd",
"metadata": {},
"outputs": [],
"source": [
"import singlestoredb.apps as apps\n",
"connection_info = await apps.run_udf_app(replace_existing=True)"
]
],
"id": "b716549f"
},
{
"attachments": {},
Expand Down Expand Up @@ -213,7 +213,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "4a825f0d",
"metadata": {},
"source": [
"## Publish Python UDF\n",
Expand All @@ -226,10 +225,11 @@
"```\n",
"\n",
"enriching your data exploration experience seamlessly!"
]
],
"id": "825e6fa2"
},
{
"id": "b6c75678",
"id": "50dab547",
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down
14 changes: 14 additions & 0 deletions notebooks/upgrade-virtual-workspace/meta.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[meta]
authors=["singlestore"]
title="Upgrade Your Virtual Workspace"
description="""\
Learn how to upgrade Your VirtualWorkspace\
to a fullfledged Workspace in a dedicated
Workspace Group.
"""
icon="browser"
difficulty="intermediate"
tags=["starter", "notebooks", "fusion"]
lesson_areas=[]
destinations=["spaces"]
minimum_tier="free-shared"
Loading