Skip to content

Commit

Permalink
Update some outdated OAuth comments (databricks#339)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacky Hu <jacky.hu@databricks.com>
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Co-authored-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
  • Loading branch information
jackyhu-db and Jesse Whitehouse authored Jan 30, 2024
1 parent faf13a4 commit 0552990
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 34 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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!)
Expand Down
17 changes: 2 additions & 15 deletions examples/interactive_oauth.py
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
17 changes: 2 additions & 15 deletions examples/persistent_oauth.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/databricks/sql/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0552990

Please sign in to comment.