about summary refs log tree commit diff
path: root/pkgs/development/python-modules/databricks-sql-connector/default.nix
blob: d5a765da18bc403803cb2f09a22155c24b14bf1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, buildPythonPackage
, fetchFromGitHub
, thrift
, pandas
, pyarrow
, poetry-core
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "databricks-sql-connector";
  version = "2.2.1";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "databricks";
    repo = "databricks-sql-python";
    rev = "refs/tags/v${version}";
    sha256 = "sha256-EMLUXGeVGIXFeaMvaJ+crivRZtOt7W/LCycIO2gwqXA=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'thrift = "^0.13.0"' 'thrift = ">=0.13.0,<1.0.0"'
  '';

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    thrift
    pandas
    pyarrow
  ];

  checkInputs = [
    pytestCheckHook
  ];

  pytestFlagsArray = [ "tests/unit" ];

  meta = with lib; {
    description = "Databricks SQL Connector for Python";
    homepage = "https://docs.databricks.com/dev-tools/python-sql-connector.html";
    license = licenses.asl20;
    maintainers = with maintainers; [ harvidsen ];
  };
}