Skip to content

Commit d6fa285

Browse files
Niall Egansusodapop
authored andcommitted
Package V2 client + prepare v2.0.0b release
Tweak client packaging for Python V2 client, bump up version t0 v2.0.0b. Go through QA SOP to prepare for release. Author: Niall Egan <niall.egan@databricks.com>
1 parent ae435ba commit d6fa285

File tree

12 files changed

+108
-2692
lines changed

12 files changed

+108
-2692
lines changed

cmdexec/clients/python/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
databricks_sql_connector.egg-info/
2+
dist/
3+
build/

cmdexec/clients/python/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Databricks SQL Connector for Python
2+
3+
**Status: Private preview**
4+
5+
Documentation can be found here: [Databricks SQL Connector for Python](https://docs.databricks.com/dev-tools/python-sql-connector.html).
6+
7+
## About
8+
9+
The Databricks SQL Connector is a Python library that allows you to use Python code to run
10+
SQL commands on Databricks clusters and Databricks SQL endpoints.
11+
This library follows [PEP 249 -- Python Database API Specification v2.0](https://www.python.org/dev/peps/pep-0249/).
12+
13+
## Quickstart
14+
15+
Install the library with `pip install databricks-sql-connector`
16+
17+
Example usage:
18+
19+
```
20+
from databricks import sql
21+
22+
connection = sql.connect(
23+
server_hostname='<server-hostname>',
24+
http_path='<http-path>',
25+
access_token='<personal-access-token>')
26+
27+
cursor = connection.cursor()
28+
29+
cursor.execute('SELECT * FROM RANGE(10)')
30+
result = cursor.fetchall()
31+
for row in result:
32+
print(row)
33+
34+
cursor.close()
35+
connection.close()
36+
```
37+
38+
Where:
39+
- `<server-hostname>` is the Databricks instance host name.
40+
- `<http-path>` is the HTTP Path either to a Databricks SQL endpoint (e.g. /sql/1.0/endpoints/1234567890abcdef),
41+
or to a Databricks Runtime interactive cluster (e.g. /sql/protocolv1/o/1234567890123456/1234-123456-slid123)
42+
- `<personal-access-token>` is a HTTP Bearer access token, e.g. a Databricks Personal Access Token.
43+
44+
For more information, see [Databricks documentation](https://docs.databricks.com/dev-tools/python-sql-connector.html).

cmdexec/clients/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = [
3-
"setuptools>=42",
3+
"setuptools>=58",
44
"wheel",
55
]
66

cmdexec/clients/python/setup.cfg

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[metadata]
2+
name = databricks-sql-connector
3+
version = attr: databricks.sql.__version__
4+
description = "Databricks SQL Connector for Python"
5+
long_description = file: README.md
6+
long_description_content_type = text/markdown
7+
url = "https://databricks.com"
8+
author = "Databricks"
9+
author_email = "feedback@databricks.com"
10+
license = "http://www.apache.org/licenses/LICENSE-2.0"
11+
classifiers =
12+
"Intended Audience :: Developers"
13+
"License :: OSI Approved :: Apache Software License"
14+
"Operating System :: OS Independent"
15+
"Topic :: Database :: Front-Ends"
16+
install_requires =
17+
thrift >= 0.13.0
18+
pyarrow >= 5.0.0
19+
pandas >= 1.0.0
20+
21+
[options]
22+
package_dir=
23+
=src
24+
packages = find:
25+
python_requires = >=3.7
26+
27+
[options.packages.find]
28+
where = src
29+
30+
[options.package_data]
31+
* = HISTORY

cmdexec/clients/python/setup.py

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
v2.0.0b - February 8, 2022
2+
- 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.
3+
- Added Unity Catalog support (pass catalog and / or schema key word args to the .connect method to select initial schema and catalog)
4+
5+
v1.0.0 - January 20, 2022
6+
- Add operations for retrieving metadata
7+
- Add the ability to access columns by name on result rows
8+
- Add the ability to provide configuration settings on connect
9+
10+
v0.9.4 - January 10, 2022
11+
- Improved logging and error messages.
12+
13+
v0.9.3 - December 8, 2021
14+
- Add retries for 429 and 503 HTTP responses.
15+
16+
v0.9.2 - December 2, 2021
17+
- (Bug fix) Increased Thrift requirement from 0.10.0 to 0.13.0 as 0.10.0 was in fact incompatible
18+
- (Bug fix) Fixed error message after query execution failed - SQLSTATE and Error message were misplaced
19+
20+
v0.9.1 - Sept 1, 2021
21+
- Public Preview release, Experimental tag removed
22+
- minor updates in internal build/packaging
23+
- no functional changes
24+
25+
v0.9.0 - Aug 4, 2021
26+
- initial (Experimental) release of pyhive-forked connector
27+
- Python DBAPI 2.0 (PEP-0249), thrift based
28+
- see docs for more info: https://docs.databricks.com/dev-tools/python-sql-connector.html

cmdexec/clients/python/src/databricks/sql/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __repr__(self):
2727
DATE = DBAPITypeObject('date')
2828
ROWID = DBAPITypeObject()
2929

30-
__version__ = "2.0.0rc2"
30+
__version__ = "2.0.0b0"
3131
USER_AGENT_NAME = "PyDatabricksSqlConnector"
3232

3333
# These two functions are pyhive legacy

cmdexec/clients/python/src/databricks/sql/api/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)