1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, thrift
5, pandas
6, pyarrow
7, poetry-core
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "databricks-sql-connector";
13 version = "2.0.5";
14 format = "pyproject";
15
16 src = fetchFromGitHub {
17 owner = "databricks";
18 repo = "databricks-sql-python";
19 rev = "v${version}";
20 sha256 = "sha256-Qpdyn6z1mbO4bzyUZ2eYdd9pfIkIP/Aj4YgNXaYwxpE=";
21 };
22
23 postPatch = ''
24 substituteInPlace pyproject.toml \
25 --replace 'thrift = "^0.13.0"' 'thrift = ">=0.13.0,<1.0.0"'
26 '';
27
28 nativeBuildInputs = [
29 poetry-core
30 ];
31
32 propagatedBuildInputs = [
33 thrift
34 pandas
35 pyarrow
36 ];
37
38 checkInputs = [
39 pytestCheckHook
40 ];
41
42 pytestFlagsArray = [ "tests/unit" ];
43
44 meta = with lib; {
45 description = "Databricks SQL Connector for Python";
46 homepage = "https://docs.databricks.com/dev-tools/python-sql-connector.html";
47 license = licenses.asl20;
48 maintainers = with maintainers; [ harvidsen ];
49 };
50}