Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.05] pyhton3Packages.databricks-sql-connector: Fix broken #331732

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pkgs/applications/misc/databricks-sql-cli/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, fetchFromGitHub
, fetchpatch
, python3
, pythonRelaxDepsHook
}:

python3.pkgs.buildPythonApplication rec {
Expand All @@ -24,15 +25,20 @@ python3.pkgs.buildPythonApplication rec {
})
];

pythonRelaxDeps = [
"pandas"
"databricks-sql-connector"
"sqlparse"
];

postPatch = ''
substituteInPlace pyproject.toml \
--replace 'python = ">=3.7.1,<4.0"' 'python = ">=3.8,<4.0"' \
--replace 'pandas = "1.3.4"' 'pandas = "~1.5"'
'';

nativeBuildInputs = with python3.pkgs; [
nativeBuildInputs = (with python3.pkgs; [
poetry-core
];
]) ++ [ pythonRelaxDepsHook ];

propagatedBuildInputs = with python3.pkgs; [
cli-helpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,41 @@
pyarrow,
pytestCheckHook,
pythonOlder,
pythonAtLeast,
pythonRelaxDepsHook,
sqlalchemy,
thrift,
requests,
urllib3,
fetchpatch,
}:

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

disabled = pythonOlder "3.7";
# Depends on thrift that at the moment do not work in Python 3.12
# see PR 328415 fix this.
disabled = pythonOlder "3.7" || pythonAtLeast "3.12";

src = fetchFromGitHub {
owner = "databricks";
repo = "databricks-sql-python";
rev = "refs/tags/v${version}";
hash = "sha256-LiA+zZuhPPXgBb8B1vZ/PuAYMrBXzxgd1CXwugf0mk8=";
hash = "sha256-a3OeKJ3c2UCClsPMah7iJY2YvIVLfHmmBuHAx8vdXZs=";
};

patches = [
(fetchpatch {
name = "fix-pandas.patch";
url = "https://patch-diff.githubusercontent.com/raw/databricks/databricks-sql-python/pull/416.patch";
sha256 = "sha256-sNCp8xSSmKP2yNzDK4wyWC5Hoe574AeHnKTeNcIxaek=";
})
];

pythonRelaxDeps = [
"numpy"
"thrift"
"pyarrow"
];

nativeBuildInputs = [
Expand All @@ -51,6 +64,8 @@ buildPythonPackage rec {
pyarrow
sqlalchemy
thrift
requests
urllib3
];

nativeCheckInputs = [ pytestCheckHook ];
Expand All @@ -65,8 +80,5 @@ buildPythonPackage rec {
changelog = "https://github.com/databricks/databricks-sql-python/blob/v${version}/CHANGELOG.md";
license = licenses.asl20;
maintainers = with maintainers; [ harvidsen ];
# No SQLAlchemy 2.0 support
# https://github.com/databricks/databricks-sql-python/issues/91
broken = true;
};
}
Loading