Skip to content

Commit 9d1c0fb

Browse files
committed
Merge branch 'main' into column-defaults
2 parents df4efd4 + a6212b6 commit 9d1c0fb

38 files changed

+2096
-1363
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# the repo. Unless a later match takes precedence, these
33
# users will be requested for review when someone opens a
44
# pull request.
5-
* @susodapop @arikfr @yunbodeng-db @andrefurlan-db
5+
* @rcypher-databricks @arikfr @yunbodeng-db @andrefurlan-db @jackyhu-db @benc-db @kravets-levko

.github/workflows/code-quality-checks.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Code Quality Checks
2-
on:
2+
on:
33
push:
44
branches:
55
- main
@@ -157,7 +157,7 @@ jobs:
157157
- name: Install library
158158
run: poetry install --no-interaction
159159
#----------------------------------------------
160-
# black the code
160+
# mypy the code
161161
#----------------------------------------------
162162
- name: Mypy
163163
run: poetry run mypy --install-types --non-interactive src

.github/workflows/integration.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Integration Tests
2+
on:
3+
push:
4+
paths-ignore:
5+
- "**.MD"
6+
- "**.md"
7+
8+
jobs:
9+
run-e2e-tests:
10+
runs-on: ubuntu-latest
11+
environment: azure-prod
12+
env:
13+
DATABRICKS_SERVER_HOSTNAME: ${{ secrets.DATABRICKS_HOST }}
14+
DATABRICKS_HTTP_PATH: ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }}
15+
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
16+
DATABRICKS_CATALOG: peco
17+
DATABRICKS_USER: ${{ secrets.TEST_PECO_SP_ID }}
18+
steps:
19+
#----------------------------------------------
20+
# check-out repo and set-up python
21+
#----------------------------------------------
22+
- name: Check out repository
23+
uses: actions/checkout@v3
24+
- name: Set up python
25+
id: setup-python
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: "3.10"
29+
#----------------------------------------------
30+
# ----- install & configure poetry -----
31+
#----------------------------------------------
32+
- name: Install Poetry
33+
uses: snok/install-poetry@v1
34+
with:
35+
virtualenvs-create: true
36+
virtualenvs-in-project: true
37+
installer-parallel: true
38+
39+
#----------------------------------------------
40+
# load cached venv if cache exists
41+
#----------------------------------------------
42+
- name: Load cached venv
43+
id: cached-poetry-dependencies
44+
uses: actions/cache@v2
45+
with:
46+
path: .venv
47+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
48+
#----------------------------------------------
49+
# install dependencies if cache does not exist
50+
#----------------------------------------------
51+
- name: Install dependencies
52+
run: poetry install --no-interaction --all-extras
53+
#----------------------------------------------
54+
# run test suite
55+
#----------------------------------------------
56+
- name: Run e2e tests
57+
run: poetry run python -m pytest tests/e2e
58+
- name: Run SQL Alchemy tests
59+
run: poetry run python -m pytest src/databricks/sqlalchemy/test_local

CHANGELOG.md

+44-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
# Release History
22

3-
# 3.0.3 (TBD)
3+
# (Unreleased)
4+
5+
- Fix: our logger would raise an uncaught exception under certain oauth error conditions
6+
7+
# 3.1.2 (2024-04-18)
8+
9+
- Remove broken cookie code (#379)
10+
- Small typing fixes (#382, #384 thanks @wyattscarpenter)
11+
12+
# 3.1.1 (2024-03-19)
13+
14+
- Don't retry requests that fail with code 403 (#373)
15+
- Assume a default retry-after for 429/503 (#371)
16+
- Fix boolean literals (#357)
17+
18+
# 3.1.0 (2024-02-16)
19+
20+
- Revert retry-after behavior to be exponential backoff (#349)
21+
- Support Databricks OAuth on Azure (#351)
22+
- Support Databricks OAuth on GCP (#338)
23+
24+
# 3.0.3 (2024-02-02)
425

526
- Revised docstrings and examples for OAuth (#339)
27+
- Redact the URL query parameters from the urllib3.connectionpool logs (#341)
628

729
# 3.0.2 (2024-01-25)
830

@@ -48,15 +70,15 @@
4870

4971
## 2.9.2 (2023-08-17)
5072

51-
__Note: this release was yanked from Pypi on 13 September 2023 due to compatibility issues with environments where `urllib3<=2.0.0` were installed. The log changes are incorporated into version 2.9.3 and greater.__
73+
**Note: this release was yanked from Pypi on 13 September 2023 due to compatibility issues with environments where `urllib3<=2.0.0` were installed. The log changes are incorporated into version 2.9.3 and greater.**
5274

5375
- Other: Add `examples/v3_retries_query_execute.py` (#199)
5476
- Other: suppress log message when `_enable_v3_retries` is not `True` (#199)
5577
- Other: make this connector backwards compatible with `urllib3>=1.0.0` (#197)
5678

5779
## 2.9.1 (2023-08-11)
5880

59-
__Note: this release was yanked from Pypi on 13 September 2023 due to compatibility issues with environments where `urllib3<=2.0.0` were installed.__
81+
**Note: this release was yanked from Pypi on 13 September 2023 due to compatibility issues with environments where `urllib3<=2.0.0` were installed.**
6082

6183
- Other: Explicitly pin urllib3 to ^2.0.0 (#191)
6284

@@ -109,6 +131,7 @@ __Note: this release was yanked from Pypi on 13 September 2023 due to compatibil
109131
- Other: Relax sqlalchemy required version as it was unecessarily strict.
110132

111133
## 2.5.0 (2023-04-14)
134+
112135
- Add support for External Auth providers
113136
- Fix: Python HTTP proxies were broken
114137
- Other: All Thrift requests that timeout during connection will be automatically retried
@@ -130,8 +153,8 @@ __Note: this release was yanked from Pypi on 13 September 2023 due to compatibil
130153

131154
## 2.2.2 (2023-01-03)
132155

133-
- Support custom oauth client id and redirect port
134-
- Fix: Add none check on _oauth_persistence in DatabricksOAuthProvider
156+
- Support custom oauth client id and redirect port
157+
- Fix: Add none check on \_oauth_persistence in DatabricksOAuthProvider
135158

136159
## 2.2.1 (2022-11-29)
137160

@@ -163,57 +186,71 @@ Huge thanks to @dbaxa for contributing this change!
163186

164187
- Add retry logic for `GetOperationStatus` requests that fail with an `OSError`
165188
- Reorganised code to use Poetry for dependency management.
189+
166190
## 2.0.2 (2022-05-04)
191+
167192
- Better exception handling in automatic connection close
168193

169194
## 2.0.1 (2022-04-21)
195+
170196
- Fixed Pandas dependency in setup.cfg to be >= 1.2.0
171197

172198
## 2.0.0 (2022-04-19)
199+
173200
- Initial stable release of V2
174-
- Added better support for complex types, so that in Databricks runtime 10.3+, Arrays, Maps and Structs will get
201+
- Added better support for complex types, so that in Databricks runtime 10.3+, Arrays, Maps and Structs will get
175202
deserialized as lists, lists of tuples and dicts, respectively.
176203
- Changed the name of the metadata arg to http_headers
177204

178205
## 2.0.b2 (2022-04-04)
206+
179207
- Change import of collections.Iterable to collections.abc.Iterable to make the library compatible with Python 3.10
180208
- Fixed bug with .tables method so that .tables works as expected with Unity-Catalog enabled endpoints
181209

182210
## 2.0.0b1 (2022-03-04)
211+
183212
- Fix packaging issue (dependencies were not being installed properly)
184213
- Fetching timestamp results will now return aware instead of naive timestamps
185214
- The client will now default to using simplified error messages
186215

187216
## 2.0.0b (2022-02-08)
217+
188218
- Initial beta release of V2. V2 is an internal re-write of large parts of the connector to use Databricks edge features. All public APIs from V1 remain.
189-
- Added Unity Catalog support (pass catalog and / or schema key word args to the .connect method to select initial schema and catalog)
219+
- Added Unity Catalog support (pass catalog and / or schema key word args to the .connect method to select initial schema and catalog)
190220

191221
---
192222

193223
**Note**: The code for versions prior to `v2.0.0b` is not contained in this repository. The below entries are included for reference only.
194224

195225
---
226+
196227
## 1.0.0 (2022-01-20)
228+
197229
- Add operations for retrieving metadata
198230
- Add the ability to access columns by name on result rows
199231
- Add the ability to provide configuration settings on connect
200232

201233
## 0.9.4 (2022-01-10)
234+
202235
- Improved logging and error messages.
203236

204237
## 0.9.3 (2021-12-08)
238+
205239
- Add retries for 429 and 503 HTTP responses.
206240

207241
## 0.9.2 (2021-12-02)
242+
208243
- (Bug fix) Increased Thrift requirement from 0.10.0 to 0.13.0 as 0.10.0 was in fact incompatible
209244
- (Bug fix) Fixed error message after query execution failed -SQLSTATE and Error message were misplaced
210245

211246
## 0.9.1 (2021-09-01)
247+
212248
- Public Preview release, Experimental tag removed
213249
- minor updates in internal build/packaging
214250
- no functional changes
215251

216252
## 0.9.0 (2021-08-04)
253+
217254
- initial (Experimental) release of pyhive-forked connector
218255
- Python DBAPI 2.0 (PEP-0249), thrift based
219256
- see docs for more info: https://docs.databricks.com/dev-tools/python-sql-connector.html

conftest.py

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import os
2+
import pytest
3+
4+
5+
@pytest.fixture(scope="session")
6+
def host():
7+
return os.getenv("DATABRICKS_SERVER_HOSTNAME")
8+
9+
10+
@pytest.fixture(scope="session")
11+
def http_path():
12+
return os.getenv("DATABRICKS_HTTP_PATH")
13+
14+
15+
@pytest.fixture(scope="session")
16+
def access_token():
17+
return os.getenv("DATABRICKS_TOKEN")
18+
19+
20+
@pytest.fixture(scope="session")
21+
def ingestion_user():
22+
return os.getenv("DATABRICKS_USER")
23+
24+
25+
@pytest.fixture(scope="session")
26+
def catalog():
27+
return os.getenv("DATABRICKS_CATALOG")
28+
29+
30+
@pytest.fixture(scope="session")
31+
def schema():
32+
return os.getenv("DATABRICKS_SCHEMA", "default")
33+
34+
35+
@pytest.fixture(scope="session", autouse=True)
36+
def connection_details(host, http_path, access_token, ingestion_user, catalog, schema):
37+
return {
38+
"host": host,
39+
"http_path": http_path,
40+
"access_token": access_token,
41+
"ingestion_user": ingestion_user,
42+
"catalog": catalog,
43+
"schema": schema,
44+
}

0 commit comments

Comments
 (0)