Skip to content

Commit c5d490f

Browse files
better example documentation
Signed-off-by: Andre Furlan <[email protected]>
1 parent 293b547 commit c5d490f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ To run all of these examples you can clone the entire repository to your disk. O
3838
this example the string `ExamplePartnerTag` will be added to the the user agent on every request.
3939
- **`staging_ingestion.py`** shows how the connector handles Databricks' experimental staging ingestion commands `GET`, `PUT`, and `REMOVE`.
4040
- **`sqlalchemy.py`** shows a basic example of connecting to Databricks with [SQLAlchemy](https://www.sqlalchemy.org/).
41+
- **`custom_cred_provider.py`** shows how to pass a custom credential provider to bypass connector authentication. Please install databricks-sdk prior to running this example.

examples/custom_cred_provider.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# please install databricks-sdk prior to running this example.
2+
13
from databricks import sql
24
from databricks.sdk.oauth import OAuthClient
35
import os
@@ -16,7 +18,7 @@
1618
http_path = os.getenv("DATABRICKS_HTTP_PATH"),
1719
credentials_provider=creds) as connection:
1820

19-
for x in range(1, 100):
21+
for x in range(1, 5):
2022
cursor = connection.cursor()
2123
cursor.execute('SELECT 1+1')
2224
result = cursor.fetchall()

0 commit comments

Comments
 (0)