2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
pytestCheckHook,
|
|
|
|
libiconv,
|
|
|
|
numpy,
|
|
|
|
protobuf,
|
|
|
|
pyarrow,
|
|
|
|
Security,
|
|
|
|
SystemConfiguration,
|
2024-09-19 14:19:46 +00:00
|
|
|
typing-extensions,
|
2024-10-04 16:56:33 +00:00
|
|
|
pythonOlder,
|
2022-01-26 04:04:25 +00:00
|
|
|
}:
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
let
|
2023-02-16 17:41:37 +00:00
|
|
|
arrow-testing = fetchFromGitHub {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "arrow-testing";
|
2023-02-16 17:41:37 +00:00
|
|
|
owner = "apache";
|
|
|
|
repo = "arrow-testing";
|
2024-10-04 16:56:33 +00:00
|
|
|
rev = "4d209492d514c2d3cb2d392681b9aa00e6d8da1c";
|
|
|
|
hash = "sha256-IkiCbuy0bWyClPZ4ZEdkEP7jFYLhM7RCuNLd6Lazd4o=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
parquet-testing = fetchFromGitHub {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "parquet-testing";
|
2023-02-16 17:41:37 +00:00
|
|
|
owner = "apache";
|
|
|
|
repo = "parquet-testing";
|
2024-10-04 16:56:33 +00:00
|
|
|
rev = "50af3d8ce206990d81014b1862e5ce7380dc3e08";
|
|
|
|
hash = "sha256-edyv/r5olkj09aHtm8LHZY0b3jUtLNUcufwI41qKYaY=";
|
2023-02-16 17:41:37 +00:00
|
|
|
};
|
2022-01-26 04:04:25 +00:00
|
|
|
in
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "datafusion";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "40.1.0";
|
2024-06-20 14:57:18 +00:00
|
|
|
pyproject = true;
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
name = "datafusion-source";
|
|
|
|
owner = "apache";
|
|
|
|
repo = "arrow-datafusion-python";
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-5WOSlx4XW9zO6oTY16lWQElShLv0ubflVPfSSEGrFgg=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "datafusion-cargo-deps";
|
2024-09-19 14:19:46 +00:00
|
|
|
inherit src;
|
|
|
|
hash = "sha256-hN03tbnH77VsMDxSMddMHIH00t7lUs5h8rTHbiMIExw=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs =
|
|
|
|
[ protobuf ]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-06-05 15:53:02 +00:00
|
|
|
libiconv
|
|
|
|
Security
|
|
|
|
SystemConfiguration
|
|
|
|
];
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = [
|
|
|
|
pyarrow
|
2024-10-04 16:56:33 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.13") [ typing-extensions ];
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
numpy
|
|
|
|
];
|
2024-09-19 14:19:46 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
pythonImportsCheck = [ "datafusion" ];
|
2024-09-19 14:19:46 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--pyargs"
|
|
|
|
pname
|
|
|
|
];
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
pushd $TMPDIR
|
|
|
|
ln -s ${arrow-testing} ./testing
|
|
|
|
ln -s ${parquet-testing} ./parquet
|
|
|
|
'';
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
postCheck = ''
|
|
|
|
popd
|
2022-01-26 04:04:25 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Extensible query execution framework";
|
|
|
|
longDescription = ''
|
|
|
|
DataFusion is an extensible query execution framework, written in Rust,
|
|
|
|
that uses Apache Arrow as its in-memory format.
|
|
|
|
'';
|
|
|
|
homepage = "https://arrow.apache.org/datafusion/";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/apache/arrow-datafusion-python/blob/${version}/CHANGELOG.md";
|
2022-01-26 04:04:25 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
|
|
};
|
|
|
|
}
|