From 2d2df086579fe8b2363ac5c2f17f521d92854476 Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Mon, 4 Mar 2024 16:25:40 -0500 Subject: [PATCH 01/12] Added Shiny for Python example. --- examples/connect/shiny-python/README.md | 32 ++++++++ examples/connect/shiny-python/app.py | 74 +++++++++++++++++++ .../connect/shiny-python/requirements.txt | 4 + 3 files changed, 110 insertions(+) create mode 100644 examples/connect/shiny-python/README.md create mode 100644 examples/connect/shiny-python/app.py create mode 100644 examples/connect/shiny-python/requirements.txt diff --git a/examples/connect/shiny-python/README.md b/examples/connect/shiny-python/README.md new file mode 100644 index 00000000..58f2eada --- /dev/null +++ b/examples/connect/shiny-python/README.md @@ -0,0 +1,32 @@ +# Shiny for Pyton Example + +## Start the app locally + +```bash +DATABRICKS_TOKEN= shiny run app.py +``` + +## Deploy to Posit Connect + +Validate that `rsconnect-python` is installed: + +```bash +rsconnect version +``` + +Or install it as documented in the [installation](https://docs.posit.co/rsconnect-python/#installation) section of the documentation. + + +To publish, make sure `MY_CONNECT_SERVER` and `MY_API_KEY` have valid values. Then, on a terminal session, enter the following command: + +```bash +rsconnect deploy shiny . --server "${MY_CONNECT_SERVER}" --api-key "${MY_CONNECT_API_KEY}" --environment --environment +``` + +Note that the Databricks environment variables do not need to be resolved by the shell, so they do not include the `$` prefix. + +The Databricks environment variables only need to be set once, unless a change needs to be made. If the values have not changed, you don’t need to provide them again when you publish updates to the document. + +``` +rsconnect deploy shiny --server "${MY_CONNECT_SERVER}" --api-key "${MY_CONNECT_API_KEY}" . +``` diff --git a/examples/connect/shiny-python/app.py b/examples/connect/shiny-python/app.py new file mode 100644 index 00000000..02d367d3 --- /dev/null +++ b/examples/connect/shiny-python/app.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# mypy: ignore-errors +import os + +from posit.connect.external.databricks import viewer_credentials_provider + +from databricks import sql +from databricks.sdk.service.iam import CurrentUserAPI +from databricks.sdk.core import ApiClient, Config + +from shiny import App, Inputs, Outputs, Session, render, ui +import pandas as pd + +query = """ +SELECT + * +FROM + samples.nyctaxi.trips +LIMIT 10; +""" + +DATABRICKS_PAT = os.getenv("DATABRICKS_TOKEN") +DATABRICKS_HOST=os.getenv("DATABRICKS_HOST") +DATABRICKS_HOST_URL = f"https://{DATABRICKS_HOST}" +SQL_HTTP_PATH = os.getenv("DATABRICKS_PATH") + +USER_SESSION_TOKEN = None + +app_ui = ui.page_fluid( + ui.output_text("text"), + ui.output_data_frame("result") +) + +def server(input: Inputs, output: Outputs, session: Session): + + credentials_provider = None + if os.getenv("CONNECT_SERVER"): + USER_SESSION_TOKEN = session.http_conn.headers['Posit-Connect-User-Session-Token'] + credentials_provider = viewer_credentials_provider(user_session_token=USER_SESSION_TOKEN) + cfg = Config(host=DATABRICKS_HOST_URL, credentials_provider=credentials_provider) + else: + cfg = Config(host=DATABRICKS_HOST_URL, token=DATABRICKS_PAT) + + databricks_user = CurrentUserAPI(ApiClient(cfg)).me() + + @render.data_frame + def result(): + + connection_settings = { + "server_hostname": DATABRICKS_HOST, + "http_path": SQL_HTTP_PATH, + } + if os.getenv("CONNECT_SERVER"): + connection_settings.update({ + "auth_type": "databricks-oauth", + "credentials_provider": credentials_provider + }) + else: + connection_settings.update({ + "access_token": DATABRICKS_PAT + }) + + with sql.connect(**connection_settings) as connection: + with connection.cursor() as cursor: + tmp = cursor.execute(query) + rows = cursor.fetchall() + df = pd.DataFrame(rows, columns = [col[0] for col in cursor.description]) + return df + + @render.text + def text(): + return f"Hello, {databricks_user.display_name}!" + +app = App(app_ui, server) diff --git a/examples/connect/shiny-python/requirements.txt b/examples/connect/shiny-python/requirements.txt new file mode 100644 index 00000000..44691daa --- /dev/null +++ b/examples/connect/shiny-python/requirements.txt @@ -0,0 +1,4 @@ +databricks-sql-connector==3.0.1 +databricks-sdk==0.20.0 +shiny==0.7.1 +git+https://github.com/posit-dev/posit-sdk-py.git From 029eb086701246afb98a40055cea79a17999b91e Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 11:18:04 -0500 Subject: [PATCH 02/12] Fixed typos and added missing details. --- examples/connect/shiny-python/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/connect/shiny-python/README.md b/examples/connect/shiny-python/README.md index 58f2eada..97189331 100644 --- a/examples/connect/shiny-python/README.md +++ b/examples/connect/shiny-python/README.md @@ -1,4 +1,4 @@ -# Shiny for Pyton Example +# Shiny for Python Example ## Start the app locally @@ -17,10 +17,10 @@ rsconnect version Or install it as documented in the [installation](https://docs.posit.co/rsconnect-python/#installation) section of the documentation. -To publish, make sure `MY_CONNECT_SERVER` and `MY_API_KEY` have valid values. Then, on a terminal session, enter the following command: +To publish, make sure `MY_CONNECT_SERVER`, `MY_CONNECT_API_KEY`, `DATABRICKS_HOST`, `DATABRICKS_PATH` have valid values. Then, on a terminal session, enter the following command: ```bash -rsconnect deploy shiny . --server "${MY_CONNECT_SERVER}" --api-key "${MY_CONNECT_API_KEY}" --environment --environment +rsconnect deploy shiny . --server "${MY_CONNECT_SERVER}" --api-key "${MY_CONNECT_API_KEY}" --environment DATABRICKS_HOST --environment DATABRICKS_PATH ``` Note that the Databricks environment variables do not need to be resolved by the shell, so they do not include the `$` prefix. From 66bd359d999ad0404dc8560ba075beb27b0998ec Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 11:49:11 -0500 Subject: [PATCH 03/12] Refactored code and added comments. --- examples/connect/shiny-python/app.py | 81 +++++++++++++++++----------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/examples/connect/shiny-python/app.py b/examples/connect/shiny-python/app.py index 02d367d3..eacb7022 100644 --- a/examples/connect/shiny-python/app.py +++ b/examples/connect/shiny-python/app.py @@ -2,6 +2,8 @@ # mypy: ignore-errors import os +import pandas as pd + from posit.connect.external.databricks import viewer_credentials_provider from databricks import sql @@ -9,56 +11,73 @@ from databricks.sdk.core import ApiClient, Config from shiny import App, Inputs, Outputs, Session, render, ui -import pandas as pd - -query = """ -SELECT - * -FROM - samples.nyctaxi.trips -LIMIT 10; -""" DATABRICKS_PAT = os.getenv("DATABRICKS_TOKEN") DATABRICKS_HOST=os.getenv("DATABRICKS_HOST") DATABRICKS_HOST_URL = f"https://{DATABRICKS_HOST}" SQL_HTTP_PATH = os.getenv("DATABRICKS_PATH") -USER_SESSION_TOKEN = None - app_ui = ui.page_fluid( ui.output_text("text"), ui.output_data_frame("result") ) -def server(input: Inputs, output: Outputs, session: Session): +def get_credentials_provider(session_token: str): + """ + Use the Posit SDK to get a credentials provider for the Databricks connection. + """ - credentials_provider = None if os.getenv("CONNECT_SERVER"): - USER_SESSION_TOKEN = session.http_conn.headers['Posit-Connect-User-Session-Token'] - credentials_provider = viewer_credentials_provider(user_session_token=USER_SESSION_TOKEN) - cfg = Config(host=DATABRICKS_HOST_URL, credentials_provider=credentials_provider) + return viewer_credentials_provider(user_session_token=session_token) + return None + +def get_connection_settings(session_token: str): + """ + Construct a connection settings dictionary that works locally and on Posit Connect. + """ + + if os.getenv("CONNECT_SERVER"): + return { + "server_hostname": DATABRICKS_HOST, + "http_path": SQL_HTTP_PATH, + "auth_type": "databricks-oauth", + "credentials_provider": get_credentials_provider(session_token=session_token) + } + return { + "server_hostname": DATABRICKS_HOST, + "http_path": SQL_HTTP_PATH, + "access_token": DATABRICKS_PAT + } + +def get_databricks_user_info(session_token: str): + """ + Use the Databricks SDK to get the current user's information. + """ + + if os.getenv("CONNECT_SERVER"): + cfg = Config( + host=DATABRICKS_HOST_URL, + credentials_provider=get_credentials_provider(session_token=session_token) + ) else: cfg = Config(host=DATABRICKS_HOST_URL, token=DATABRICKS_PAT) - databricks_user = CurrentUserAPI(ApiClient(cfg)).me() + return CurrentUserAPI(ApiClient(cfg)).me() + +def server(input: Inputs, output: Outputs, session: Session): + """ + Shiny for Python example application that shows user information and + the first few rows from a table hosted in Databricks. + """ + + session_token = session.http_conn.headers.get('Posit-Connect-User-Session-Token') + databricks_user_info = get_databricks_user_info(session_token=session_token) @render.data_frame def result(): - connection_settings = { - "server_hostname": DATABRICKS_HOST, - "http_path": SQL_HTTP_PATH, - } - if os.getenv("CONNECT_SERVER"): - connection_settings.update({ - "auth_type": "databricks-oauth", - "credentials_provider": credentials_provider - }) - else: - connection_settings.update({ - "access_token": DATABRICKS_PAT - }) + query = "SELECT * FROM samples.nyctaxi.trips LIMIT 10;" + connection_settings = get_connection_settings(session_token=session_token) with sql.connect(**connection_settings) as connection: with connection.cursor() as cursor: @@ -69,6 +88,6 @@ def result(): @render.text def text(): - return f"Hello, {databricks_user.display_name}!" + return f"Hello, {databricks_user_info.display_name}!" app = App(app_ui, server) From fba647f45f3dfddf8c6781eeca0a7b06f15b760b Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 11:58:36 -0500 Subject: [PATCH 04/12] Fixed linting errors. --- examples/connect/shiny-python/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/connect/shiny-python/app.py b/examples/connect/shiny-python/app.py index eacb7022..d4101a15 100644 --- a/examples/connect/shiny-python/app.py +++ b/examples/connect/shiny-python/app.py @@ -81,7 +81,7 @@ def result(): with sql.connect(**connection_settings) as connection: with connection.cursor() as cursor: - tmp = cursor.execute(query) + cursor.execute(query) rows = cursor.fetchall() df = pd.DataFrame(rows, columns = [col[0] for col in cursor.description]) return df From 9b113e2916e0c77af069052dbfa552d1eb761830 Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 14:52:03 -0500 Subject: [PATCH 05/12] Improved formatting. --- examples/connect/shiny-python/README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/connect/shiny-python/README.md b/examples/connect/shiny-python/README.md index 97189331..66ee7971 100644 --- a/examples/connect/shiny-python/README.md +++ b/examples/connect/shiny-python/README.md @@ -16,11 +16,14 @@ rsconnect version Or install it as documented in the [installation](https://docs.posit.co/rsconnect-python/#installation) section of the documentation. - To publish, make sure `MY_CONNECT_SERVER`, `MY_CONNECT_API_KEY`, `DATABRICKS_HOST`, `DATABRICKS_PATH` have valid values. Then, on a terminal session, enter the following command: ```bash -rsconnect deploy shiny . --server "${MY_CONNECT_SERVER}" --api-key "${MY_CONNECT_API_KEY}" --environment DATABRICKS_HOST --environment DATABRICKS_PATH +rsconnect deploy shiny . \ + --server "${MY_CONNECT_SERVER}" \ + --api-key "${MY_CONNECT_API_KEY}" \ + --environment DATABRICKS_HOST \ + --environment DATABRICKS_PATH ``` Note that the Databricks environment variables do not need to be resolved by the shell, so they do not include the `$` prefix. @@ -28,5 +31,7 @@ Note that the Databricks environment variables do not need to be resolved by the The Databricks environment variables only need to be set once, unless a change needs to be made. If the values have not changed, you don’t need to provide them again when you publish updates to the document. ``` -rsconnect deploy shiny --server "${MY_CONNECT_SERVER}" --api-key "${MY_CONNECT_API_KEY}" . +rsconnect deploy shiny . \ + --server "${MY_CONNECT_SERVER}" \ + --api-key "${MY_CONNECT_API_KEY}" ``` From d3d1a37253e5421c6b48802eb5a141c9e7a82130 Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 14:52:41 -0500 Subject: [PATCH 06/12] Removed unnecessary function. --- examples/connect/shiny-python/app.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/examples/connect/shiny-python/app.py b/examples/connect/shiny-python/app.py index d4101a15..2a46c21b 100644 --- a/examples/connect/shiny-python/app.py +++ b/examples/connect/shiny-python/app.py @@ -22,15 +22,6 @@ ui.output_data_frame("result") ) -def get_credentials_provider(session_token: str): - """ - Use the Posit SDK to get a credentials provider for the Databricks connection. - """ - - if os.getenv("CONNECT_SERVER"): - return viewer_credentials_provider(user_session_token=session_token) - return None - def get_connection_settings(session_token: str): """ Construct a connection settings dictionary that works locally and on Posit Connect. @@ -41,7 +32,7 @@ def get_connection_settings(session_token: str): "server_hostname": DATABRICKS_HOST, "http_path": SQL_HTTP_PATH, "auth_type": "databricks-oauth", - "credentials_provider": get_credentials_provider(session_token=session_token) + "credentials_provider": viewer_credentials_provider(user_session_token=session_token) } return { "server_hostname": DATABRICKS_HOST, @@ -57,7 +48,7 @@ def get_databricks_user_info(session_token: str): if os.getenv("CONNECT_SERVER"): cfg = Config( host=DATABRICKS_HOST_URL, - credentials_provider=get_credentials_provider(session_token=session_token) + credentials_provider=viewer_credentials_provider(user_session_token=session_token) ) else: cfg = Config(host=DATABRICKS_HOST_URL, token=DATABRICKS_PAT) From 96efd28821a7f45a520209881203abc11fe5bb2c Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 16:20:24 -0500 Subject: [PATCH 07/12] Refactored code so credentials_provider is created once. --- examples/connect/shiny-python/app.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/connect/shiny-python/app.py b/examples/connect/shiny-python/app.py index 2a46c21b..7c495e6e 100644 --- a/examples/connect/shiny-python/app.py +++ b/examples/connect/shiny-python/app.py @@ -22,7 +22,7 @@ ui.output_data_frame("result") ) -def get_connection_settings(session_token: str): +def get_connection_settings(credentials_provider): """ Construct a connection settings dictionary that works locally and on Posit Connect. """ @@ -32,7 +32,7 @@ def get_connection_settings(session_token: str): "server_hostname": DATABRICKS_HOST, "http_path": SQL_HTTP_PATH, "auth_type": "databricks-oauth", - "credentials_provider": viewer_credentials_provider(user_session_token=session_token) + "credentials_provider": credentials_provider } return { "server_hostname": DATABRICKS_HOST, @@ -40,7 +40,7 @@ def get_connection_settings(session_token: str): "access_token": DATABRICKS_PAT } -def get_databricks_user_info(session_token: str): +def get_databricks_user_info(credentials_provider): """ Use the Databricks SDK to get the current user's information. """ @@ -48,7 +48,7 @@ def get_databricks_user_info(session_token: str): if os.getenv("CONNECT_SERVER"): cfg = Config( host=DATABRICKS_HOST_URL, - credentials_provider=viewer_credentials_provider(user_session_token=session_token) + credentials_provider=credentials_provider ) else: cfg = Config(host=DATABRICKS_HOST_URL, token=DATABRICKS_PAT) @@ -62,13 +62,14 @@ def server(input: Inputs, output: Outputs, session: Session): """ session_token = session.http_conn.headers.get('Posit-Connect-User-Session-Token') - databricks_user_info = get_databricks_user_info(session_token=session_token) + credentials_provider = viewer_credentials_provider(user_session_token=session_token) + databricks_user_info = get_databricks_user_info(credentials_provider=credentials_provider) @render.data_frame def result(): query = "SELECT * FROM samples.nyctaxi.trips LIMIT 10;" - connection_settings = get_connection_settings(session_token=session_token) + connection_settings = get_connection_settings(credentials_provider=credentials_provider) with sql.connect(**connection_settings) as connection: with connection.cursor() as cursor: From b77a35089370fd61136e46515edc3efeafb14ff4 Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 16:35:13 -0500 Subject: [PATCH 08/12] Removed get_connection_settings since it was not necessary. --- examples/connect/shiny-python/app.py | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/examples/connect/shiny-python/app.py b/examples/connect/shiny-python/app.py index 7c495e6e..e0519f4f 100644 --- a/examples/connect/shiny-python/app.py +++ b/examples/connect/shiny-python/app.py @@ -22,24 +22,6 @@ ui.output_data_frame("result") ) -def get_connection_settings(credentials_provider): - """ - Construct a connection settings dictionary that works locally and on Posit Connect. - """ - - if os.getenv("CONNECT_SERVER"): - return { - "server_hostname": DATABRICKS_HOST, - "http_path": SQL_HTTP_PATH, - "auth_type": "databricks-oauth", - "credentials_provider": credentials_provider - } - return { - "server_hostname": DATABRICKS_HOST, - "http_path": SQL_HTTP_PATH, - "access_token": DATABRICKS_PAT - } - def get_databricks_user_info(credentials_provider): """ Use the Databricks SDK to get the current user's information. @@ -69,9 +51,11 @@ def server(input: Inputs, output: Outputs, session: Session): def result(): query = "SELECT * FROM samples.nyctaxi.trips LIMIT 10;" - connection_settings = get_connection_settings(credentials_provider=credentials_provider) - with sql.connect(**connection_settings) as connection: + with sql.connect(server_hostname=DATABRICKS_HOST, + http_path=SQL_HTTP_PATH, + auth_type="databricks-oauth", + credentials_provider=credentials_provider) as connection: with connection.cursor() as cursor: cursor.execute(query) rows = cursor.fetchall() From a6f21061486e29d37ab53fd2efebf4caf2e6ae2d Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 16:41:44 -0500 Subject: [PATCH 09/12] Refactored code to simplify layout. --- examples/connect/shiny-python/app.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/examples/connect/shiny-python/app.py b/examples/connect/shiny-python/app.py index e0519f4f..37e7b1a8 100644 --- a/examples/connect/shiny-python/app.py +++ b/examples/connect/shiny-python/app.py @@ -22,21 +22,6 @@ ui.output_data_frame("result") ) -def get_databricks_user_info(credentials_provider): - """ - Use the Databricks SDK to get the current user's information. - """ - - if os.getenv("CONNECT_SERVER"): - cfg = Config( - host=DATABRICKS_HOST_URL, - credentials_provider=credentials_provider - ) - else: - cfg = Config(host=DATABRICKS_HOST_URL, token=DATABRICKS_PAT) - - return CurrentUserAPI(ApiClient(cfg)).me() - def server(input: Inputs, output: Outputs, session: Session): """ Shiny for Python example application that shows user information and @@ -45,7 +30,6 @@ def server(input: Inputs, output: Outputs, session: Session): session_token = session.http_conn.headers.get('Posit-Connect-User-Session-Token') credentials_provider = viewer_credentials_provider(user_session_token=session_token) - databricks_user_info = get_databricks_user_info(credentials_provider=credentials_provider) @render.data_frame def result(): @@ -64,6 +48,10 @@ def result(): @render.text def text(): + cfg = Config( + host=DATABRICKS_HOST_URL, credentials_provider=credentials_provider + ) + databricks_user_info = CurrentUserAPI(ApiClient(cfg)).me() return f"Hello, {databricks_user_info.display_name}!" app = App(app_ui, server) From 27443f1456cf03f885f77b29aab9e4d7383920aa Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 16:43:52 -0500 Subject: [PATCH 10/12] Updated readme based on review feedback. --- examples/connect/shiny-python/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/connect/shiny-python/README.md b/examples/connect/shiny-python/README.md index 66ee7971..1099150f 100644 --- a/examples/connect/shiny-python/README.md +++ b/examples/connect/shiny-python/README.md @@ -3,7 +3,7 @@ ## Start the app locally ```bash -DATABRICKS_TOKEN= shiny run app.py +shiny run app.py ``` ## Deploy to Posit Connect @@ -16,7 +16,7 @@ rsconnect version Or install it as documented in the [installation](https://docs.posit.co/rsconnect-python/#installation) section of the documentation. -To publish, make sure `MY_CONNECT_SERVER`, `MY_CONNECT_API_KEY`, `DATABRICKS_HOST`, `DATABRICKS_PATH` have valid values. Then, on a terminal session, enter the following command: +To publish, make sure `CONNECT_SERVER`, `CONNECT_API_KEY`, `DATABRICKS_HOST`, `DATABRICKS_PATH` have valid values. Then, on a terminal session, enter the following command: ```bash rsconnect deploy shiny . \ From 746178d150651dfefd699c5a10437427ccf57be2 Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 16:58:35 -0500 Subject: [PATCH 11/12] Updated readme based on review feedback. --- examples/connect/shiny-python/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/connect/shiny-python/README.md b/examples/connect/shiny-python/README.md index 1099150f..a6e5fe02 100644 --- a/examples/connect/shiny-python/README.md +++ b/examples/connect/shiny-python/README.md @@ -20,8 +20,8 @@ To publish, make sure `CONNECT_SERVER`, `CONNECT_API_KEY`, `DATABRICKS_HOST`, `D ```bash rsconnect deploy shiny . \ - --server "${MY_CONNECT_SERVER}" \ - --api-key "${MY_CONNECT_API_KEY}" \ + --server "${CONNECT_SERVER}" \ + --api-key "${CONNECT_API_KEY}" \ --environment DATABRICKS_HOST \ --environment DATABRICKS_PATH ``` @@ -32,6 +32,6 @@ The Databricks environment variables only need to be set once, unless a change n ``` rsconnect deploy shiny . \ - --server "${MY_CONNECT_SERVER}" \ - --api-key "${MY_CONNECT_API_KEY}" + --server "${CONNECT_SERVER}" \ + --api-key "${CONNECT_API_KEY}" ``` From 04bf5f68f6a0c84dfeac158136822a3c1c14d580 Mon Sep 17 00:00:00 2001 From: Pablo Bianco Lascaray Date: Tue, 5 Mar 2024 17:11:05 -0500 Subject: [PATCH 12/12] Removed unused variable. --- examples/connect/shiny-python/app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/connect/shiny-python/app.py b/examples/connect/shiny-python/app.py index 37e7b1a8..97768150 100644 --- a/examples/connect/shiny-python/app.py +++ b/examples/connect/shiny-python/app.py @@ -12,7 +12,6 @@ from shiny import App, Inputs, Outputs, Session, render, ui -DATABRICKS_PAT = os.getenv("DATABRICKS_TOKEN") DATABRICKS_HOST=os.getenv("DATABRICKS_HOST") DATABRICKS_HOST_URL = f"https://{DATABRICKS_HOST}" SQL_HTTP_PATH = os.getenv("DATABRICKS_PATH")