diff --git a/CHANGELOG.md b/CHANGELOG.md index 2138b5c2..56034b17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +# 3.0.3 (TBD) + +- Revised docstrings and examples for OAuth (#339) + # 3.0.2 (2024-01-25) - SQLAlchemy dialect now supports table and column comments (thanks @cbornet!) diff --git a/examples/interactive_oauth.py b/examples/interactive_oauth.py index c520d96a..d7c59597 100644 --- a/examples/interactive_oauth.py +++ b/examples/interactive_oauth.py @@ -1,29 +1,16 @@ from databricks import sql import os -"""Bring Your Own Identity Provider with fined grained OAuth scopes is currently public preview on -Databricks in AWS. databricks-sql-connector supports user to machine OAuth login which means the -end user has to be present to login in a browser which will be popped up by the Python process. You -must enable OAuth in your Databricks account to run this example. More information on how to enable -OAuth in your Databricks Account in AWS can be found here: - -https://docs.databricks.com/administration-guide/account-settings-e2/single-sign-on.html +"""databricks-sql-connector supports user to machine OAuth login which means the +end user has to be present to login in a browser which will be popped up by the Python process. Pre-requisites: -- You have a Databricks account in AWS. -- You have configured OAuth in Databricks account in AWS using the link above. - You have installed a browser (Chrome, Firefox, Safari, Internet Explorer, etc) that will be accessible on the machine for performing OAuth login. This code does not persist the auth token. Hence after the Python process terminates the end user will have to login again. See examples/persistent_oauth.py to learn about persisting the token across script executions. - -Bring Your Own Identity Provider is in public preview. The API may change prior to becoming GA. -You can monitor these two links to find out when it will become generally available: - - 1. https://docs.databricks.com/administration-guide/account-settings-e2/single-sign-on.html - 2. https://docs.databricks.com/dev-tools/python-sql-connector.html """ with sql.connect(server_hostname = os.getenv("DATABRICKS_SERVER_HOSTNAME"), diff --git a/examples/persistent_oauth.py b/examples/persistent_oauth.py index b5b14d15..7ea83a2f 100644 --- a/examples/persistent_oauth.py +++ b/examples/persistent_oauth.py @@ -1,14 +1,7 @@ -"""Bring Your Own Identity Provider with fined grained OAuth scopes is currently public preview on -Databricks in AWS. databricks-sql-connector supports user to machine OAuth login which means the -end user has to be present to login in a browser which will be popped up by the Python process. You -must enable OAuth in your Databricks account to run this example. More information on how to enable -OAuth in your Databricks Account in AWS can be found here: - -https://docs.databricks.com/administration-guide/account-settings-e2/single-sign-on.html +"""databricks-sql-connector supports user to machine OAuth login which means the +end user has to be present to login in a browser which will be popped up by the Python process. Pre-requisites: -- You have a Databricks account in AWS. -- You have configured OAuth in Databricks account in AWS using the link above. - You have installed a browser (Chrome, Firefox, Safari, Internet Explorer, etc) that will be accessible on the machine for performing OAuth login. @@ -18,12 +11,6 @@ shows which methods you may implement. For this example, the DevOnlyFilePersistence class is provided. Do not use this in production. - -Bring Your Own Identity Provider is in public preview. The API may change prior to becoming GA. -You can monitor these two links to find out when it will become generally available: - - 1. https://docs.databricks.com/administration-guide/account-settings-e2/single-sign-on.html - 2. https://docs.databricks.com/dev-tools/python-sql-connector.html """ import os diff --git a/src/databricks/sql/client.py b/src/databricks/sql/client.py index 7417161f..45f116f0 100644 --- a/src/databricks/sql/client.py +++ b/src/databricks/sql/client.py @@ -97,10 +97,6 @@ def __init__( a warning log message. To suppress this log message, set `use_inline_params="silent"`. auth_type: `str`, optional `databricks-oauth` : to use oauth with fine-grained permission scopes, set to `databricks-oauth`. - This is currently in private preview for Databricks accounts on AWS. - This supports User to Machine OAuth authentication for Databricks on AWS with - any IDP configured. This is only for interactive python applications and open a browser window. - Note this is beta (private preview) oauth_client_id: `str`, optional custom oauth client_id. If not specified, it will use the built-in client_id of databricks-sql-python.