1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 alembic,
6 lz4,
7 numpy,
8 oauthlib,
9 openpyxl,
10 pandas,
11 poetry-core,
12 pyarrow,
13 pytestCheckHook,
14 pythonOlder,
15 pythonRelaxDepsHook,
16 sqlalchemy,
17 thrift,
18}:
19
20buildPythonPackage rec {
21 pname = "databricks-sql-connector";
22 version = "3.1.0";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.7";
26
27 src = fetchFromGitHub {
28 owner = "databricks";
29 repo = "databricks-sql-python";
30 rev = "refs/tags/v${version}";
31 hash = "sha256-LiA+zZuhPPXgBb8B1vZ/PuAYMrBXzxgd1CXwugf0mk8=";
32 };
33
34 pythonRelaxDeps = [
35 "numpy"
36 "thrift"
37 ];
38
39 nativeBuildInputs = [
40 poetry-core
41 pythonRelaxDepsHook
42 ];
43
44 propagatedBuildInputs = [
45 alembic
46 lz4
47 numpy
48 oauthlib
49 openpyxl
50 pandas
51 pyarrow
52 sqlalchemy
53 thrift
54 ];
55
56 nativeCheckInputs = [ pytestCheckHook ];
57
58 pytestFlagsArray = [ "tests/unit" ];
59
60 pythonImportsCheck = [ "databricks" ];
61
62 meta = with lib; {
63 description = "Databricks SQL Connector for Python";
64 homepage = "https://docs.databricks.com/dev-tools/python-sql-connector.html";
65 changelog = "https://github.com/databricks/databricks-sql-python/blob/v${version}/CHANGELOG.md";
66 license = licenses.asl20;
67 maintainers = with maintainers; [ harvidsen ];
68 # No SQLAlchemy 2.0 support
69 # https://github.com/databricks/databricks-sql-python/issues/91
70 broken = true;
71 };
72}