databricks-sql-connector 0.9.3__tar.gz → 2.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {databricks-sql-connector-0.9.3/databricks_sql_connector.egg-info → databricks-sql-connector-2.0.1}/PKG-INFO +4 -6
- {databricks-sql-connector-0.9.3 → databricks-sql-connector-2.0.1}/README.md +2 -3
- databricks-sql-connector-2.0.1/pyproject.toml +7 -0
- databricks-sql-connector-2.0.1/setup.cfg +36 -0
- databricks-sql-connector-2.0.1/src/databricks/__init__.py +0 -0
- databricks-sql-connector-2.0.1/src/databricks/sql/HISTORY +46 -0
- databricks-sql-connector-0.9.3/databricks/sql/dbapi.py → databricks-sql-connector-2.0.1/src/databricks/sql/__init__.py +19 -7
- databricks-sql-connector-2.0.1/src/databricks/sql/client.py +654 -0
- databricks-sql-connector-2.0.1/src/databricks/sql/exc.py +92 -0
- {databricks-sql-connector-0.9.3/databricks/sql → databricks-sql-connector-2.0.1/src/databricks/sql/thrift_api}/TCLIService/TCLIService.py +515 -473
- {databricks-sql-connector-0.9.3/databricks/sql → databricks-sql-connector-2.0.1/src/databricks/sql/thrift_api}/TCLIService/__init__.py +0 -0
- {databricks-sql-connector-0.9.3/databricks/sql → databricks-sql-connector-2.0.1/src/databricks/sql/thrift_api}/TCLIService/constants.py +18 -16
- databricks-sql-connector-2.0.1/src/databricks/sql/thrift_api/TCLIService/ttypes.py +84919 -0
- databricks-sql-connector-2.0.1/src/databricks/sql/thrift_api/__init__.py +0 -0
- databricks-sql-connector-2.0.1/src/databricks/sql/thrift_backend.py +746 -0
- databricks-sql-connector-2.0.1/src/databricks/sql/types.py +195 -0
- databricks-sql-connector-2.0.1/src/databricks/sql/utils.py +158 -0
- {databricks-sql-connector-0.9.3 → databricks-sql-connector-2.0.1/src/databricks_sql_connector.egg-info}/PKG-INFO +4 -6
- databricks-sql-connector-2.0.1/src/databricks_sql_connector.egg-info/SOURCES.txt +21 -0
- {databricks-sql-connector-0.9.3 → databricks-sql-connector-2.0.1/src}/databricks_sql_connector.egg-info/dependency_links.txt +0 -0
- databricks-sql-connector-2.0.1/src/databricks_sql_connector.egg-info/requires.txt +3 -0
- {databricks-sql-connector-0.9.3 → databricks-sql-connector-2.0.1/src}/databricks_sql_connector.egg-info/top_level.txt +0 -0
- databricks-sql-connector-0.9.3/HISTORY +0 -16
- databricks-sql-connector-0.9.3/LICENSE +0 -13
- databricks-sql-connector-0.9.3/NOTICE +0 -23
- databricks-sql-connector-0.9.3/databricks/__init__.py +0 -1
- databricks-sql-connector-0.9.3/databricks/sql/TCLIService/ttypes.py +0 -7210
- databricks-sql-connector-0.9.3/databricks/sql/__init__.py +0 -28
- databricks-sql-connector-0.9.3/databricks/sql/client.py +0 -601
- databricks-sql-connector-0.9.3/databricks/sql/common.py +0 -240
- databricks-sql-connector-0.9.3/databricks/sql/exc.py +0 -72
- databricks-sql-connector-0.9.3/databricks_sql_connector.egg-info/SOURCES.txt +0 -20
- databricks-sql-connector-0.9.3/databricks_sql_connector.egg-info/requires.txt +0 -2
- databricks-sql-connector-0.9.3/setup.cfg +0 -4
- databricks-sql-connector-0.9.3/setup.py +0 -32
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: databricks-sql-connector
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: Databricks SQL Connector for Python
|
|
5
5
|
Home-page: https://databricks.com
|
|
6
6
|
Author: Databricks
|
|
@@ -11,16 +11,14 @@ Classifier: Intended Audience :: Developers
|
|
|
11
11
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
|
13
13
|
Classifier: Topic :: Database :: Front-Ends
|
|
14
|
+
Requires-Python: >=3.7
|
|
14
15
|
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
License-File: NOTICE
|
|
17
16
|
|
|
18
17
|
# Databricks SQL Connector for Python
|
|
19
18
|
|
|
20
|
-
**Status:
|
|
19
|
+
**Status: Private preview**
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
](https://docs.databricks.com/dev-tools/python-sql-connector.html).
|
|
21
|
+
Documentation can be found here: [Databricks SQL Connector for Python](https://docs.databricks.com/dev-tools/python-sql-connector.html).
|
|
24
22
|
|
|
25
23
|
## About
|
|
26
24
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# Databricks SQL Connector for Python
|
|
2
2
|
|
|
3
|
-
**Status:
|
|
3
|
+
**Status: Private preview**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
](https://docs.databricks.com/dev-tools/python-sql-connector.html).
|
|
5
|
+
Documentation can be found here: [Databricks SQL Connector for Python](https://docs.databricks.com/dev-tools/python-sql-connector.html).
|
|
7
6
|
|
|
8
7
|
## About
|
|
9
8
|
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
|
|
17
|
+
[options]
|
|
18
|
+
package_dir =
|
|
19
|
+
=src
|
|
20
|
+
packages = find:
|
|
21
|
+
python_requires = >=3.7
|
|
22
|
+
install_requires =
|
|
23
|
+
thrift >= 0.13.0
|
|
24
|
+
pyarrow >= 5.0.0
|
|
25
|
+
pandas >= 1.3.0
|
|
26
|
+
|
|
27
|
+
[options.packages.find]
|
|
28
|
+
where = src
|
|
29
|
+
|
|
30
|
+
[options.package_data]
|
|
31
|
+
* = HISTORY
|
|
32
|
+
|
|
33
|
+
[egg_info]
|
|
34
|
+
tag_build =
|
|
35
|
+
tag_date = 0
|
|
36
|
+
|
|
File without changes
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
v2.0.1 - April 21, 2022
|
|
2
|
+
- Fixed Pandas dependency in setup.cfg to be >= 1.2.0
|
|
3
|
+
|
|
4
|
+
v2.0.0 - April 19, 2022
|
|
5
|
+
- Initial stable release of V2
|
|
6
|
+
- Added better support for complex types, so that in Databricks runtime 10.3+, Arrays, Maps and Structs will get
|
|
7
|
+
deserialized as lists, lists of tuples and dicts, respectively.
|
|
8
|
+
- Changed the name of the metadata arg to http_headers
|
|
9
|
+
|
|
10
|
+
v2.0.b2 - April 4, 2022
|
|
11
|
+
- Change import of collections.Iterable to collections.abc.Iterable to make the library compatible with Python 3.10
|
|
12
|
+
- Fixed bug with .tables method so that .tables works as expected with Unity-Catalog enabled endpoints
|
|
13
|
+
|
|
14
|
+
v2.0.0b1 - March 4, 2022
|
|
15
|
+
- Fix packaging issue (dependencies were not being installed properly)
|
|
16
|
+
- Fetching timestamp results will now return aware instead of naive timestamps
|
|
17
|
+
- The client will now default to using simplified error messages
|
|
18
|
+
|
|
19
|
+
v2.0.0b - February 8, 2022
|
|
20
|
+
- 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.
|
|
21
|
+
- Added Unity Catalog support (pass catalog and / or schema key word args to the .connect method to select initial schema and catalog)
|
|
22
|
+
|
|
23
|
+
v1.0.0 - January 20, 2022
|
|
24
|
+
- Add operations for retrieving metadata
|
|
25
|
+
- Add the ability to access columns by name on result rows
|
|
26
|
+
- Add the ability to provide configuration settings on connect
|
|
27
|
+
|
|
28
|
+
v0.9.4 - January 10, 2022
|
|
29
|
+
- Improved logging and error messages.
|
|
30
|
+
|
|
31
|
+
v0.9.3 - December 8, 2021
|
|
32
|
+
- Add retries for 429 and 503 HTTP responses.
|
|
33
|
+
|
|
34
|
+
v0.9.2 - December 2, 2021
|
|
35
|
+
- (Bug fix) Increased Thrift requirement from 0.10.0 to 0.13.0 as 0.10.0 was in fact incompatible
|
|
36
|
+
- (Bug fix) Fixed error message after query execution failed - SQLSTATE and Error message were misplaced
|
|
37
|
+
|
|
38
|
+
v0.9.1 - Sept 1, 2021
|
|
39
|
+
- Public Preview release, Experimental tag removed
|
|
40
|
+
- minor updates in internal build/packaging
|
|
41
|
+
- no functional changes
|
|
42
|
+
|
|
43
|
+
v0.9.0 - Aug 4, 2021
|
|
44
|
+
- initial (Experimental) release of pyhive-forked connector
|
|
45
|
+
- Python DBAPI 2.0 (PEP-0249), thrift based
|
|
46
|
+
- see docs for more info: https://docs.databricks.com/dev-tools/python-sql-connector.html
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import datetime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from databricks.sql.exc import *
|
|
4
|
+
|
|
4
5
|
# PEP 249 module globals
|
|
5
|
-
#
|
|
6
6
|
apilevel = '2.0'
|
|
7
7
|
threadsafety = 1 # Threads may share the module, but not connections.
|
|
8
8
|
paramstyle = 'pyformat' # Python extended format codes, e.g. ...WHERE name=%(name)s
|
|
9
9
|
|
|
10
|
-
#
|
|
11
|
-
# Type Objects and Constructors
|
|
12
|
-
#
|
|
13
10
|
|
|
14
11
|
class DBAPITypeObject(object):
|
|
15
12
|
def __init__(self, *values):
|
|
@@ -18,19 +15,34 @@ class DBAPITypeObject(object):
|
|
|
18
15
|
def __eq__(self, other):
|
|
19
16
|
return other in self.values
|
|
20
17
|
|
|
18
|
+
def __repr__(self):
|
|
19
|
+
return "DBAPITypeObject({})".format(self.values)
|
|
20
|
+
|
|
21
|
+
|
|
21
22
|
STRING = DBAPITypeObject('string')
|
|
22
23
|
BINARY = DBAPITypeObject('binary')
|
|
23
|
-
NUMBER = DBAPITypeObject('boolean', 'tinyint', 'smallint', 'int', 'bigint',
|
|
24
|
-
'
|
|
24
|
+
NUMBER = DBAPITypeObject('boolean', 'tinyint', 'smallint', 'int', 'bigint', 'float', 'double',
|
|
25
|
+
'decimal')
|
|
25
26
|
DATETIME = DBAPITypeObject('timestamp')
|
|
26
27
|
DATE = DBAPITypeObject('date')
|
|
27
28
|
ROWID = DBAPITypeObject()
|
|
28
29
|
|
|
30
|
+
__version__ = "2.0.1"
|
|
31
|
+
USER_AGENT_NAME = "PyDatabricksSqlConnector"
|
|
32
|
+
|
|
33
|
+
# These two functions are pyhive legacy
|
|
29
34
|
Date = datetime.date
|
|
30
35
|
Timestamp = datetime.datetime
|
|
31
36
|
|
|
37
|
+
|
|
32
38
|
def DateFromTicks(ticks):
|
|
33
39
|
return Date(*time.localtime(ticks)[:3])
|
|
34
40
|
|
|
41
|
+
|
|
35
42
|
def TimestampFromTicks(ticks):
|
|
36
43
|
return Timestamp(*time.localtime(ticks)[:6])
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def connect(server_hostname, http_path, access_token, **kwargs):
|
|
47
|
+
from .client import Connection
|
|
48
|
+
return Connection(server_hostname, http_path, access_token, **kwargs)
|