python3Packages.polars: 1.31.0 -> 1.36.1 (#472819)

This commit is contained in:
Gaétan Lepage
2025-12-22 13:26:44 +00:00
committed by GitHub
5 changed files with 33 additions and 66 deletions
@@ -22,14 +22,14 @@
buildPythonPackage rec {
pname = "narwhals";
version = "2.10.0";
version = "2.14.0";
pyproject = true;
src = fetchFromGitHub {
owner = "narwhals-dev";
repo = "narwhals";
tag = "v${version}";
hash = "sha256-a/X6LVzFxtjyaFcgZapJZ5i9h5LSB39XjGu/HdhPf8k=";
hash = "sha256-5yynyaY5NuxSGEro4pDzFFkf0PsYArzlB23lXYmzydY=";
};
build-system = [ hatchling ];
@@ -1,15 +0,0 @@
diff --git a/crates/polars-compute/src/lib.rs b/crates/polars-compute/src/lib.rs
index ebe1ef753..6e1eee897 100644
--- a/crates/polars-compute/src/lib.rs
+++ b/crates/polars-compute/src/lib.rs
@@ -5,6 +5,10 @@
all(feature = "simd", target_arch = "x86_64"),
feature(stdarch_x86_avx512)
)]
+#![cfg_attr(
+ all(feature = "simd", target_arch = "x86_64"),
+ feature(avx512_target_feature)
+)]
use arrow::types::NativeType;
@@ -1,6 +1,7 @@
{
lib,
stdenv,
build,
buildPythonPackage,
cargo,
cmake,
@@ -15,7 +16,7 @@
rustc,
rustPlatform,
runCommand,
setuptools,
mimalloc,
jemalloc,
rust-jemalloc-sys,
@@ -40,7 +41,7 @@
}:
let
version = "1.31.0";
version = "1.36.1";
# Hide symbols to prevent accidental use
rust-jemalloc-sys = throw "polars: use polarsMemoryAllocator over rust-jemalloc-sys";
@@ -50,34 +51,26 @@ in
buildPythonPackage rec {
pname = "polars";
inherit version;
format = "setuptools";
pyproject = true;
src = fetchFromGitHub {
owner = "pola-rs";
repo = "polars";
tag = "py-${version}";
hash = "sha256-OZ7guV/uxa3jGesAh+ubrFjQSNVp5ImfXfPAQxagTj0=";
hash = "sha256-0usMg/xQZOzrLf2gIfNFtzj96cYVzq5gFaKTFLqyfK0=";
};
patches = [
./avx512.patch
];
# Do not type-check assertions because some of them use unstable features (`is_none_or`)
postPatch = ''
while IFS= read -r -d "" path ; do
sed -i 's \(\s*\)debug_assert! \1#[cfg(debug_assertions)]\n\1debug_assert! ' "$path"
done < <( find -iname '*.rs' -print0 )
'';
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-yGTXUW6IVa+nRpmnkEl20/RJ/mxTSAaokETT8QLE+Ns=";
hash = "sha256-20AI4AGSxnmYitQjfwTFwxMBplEqvN4WXPFdoqJBgSg=";
};
requiredSystemFeatures = [ "big-parallel" ];
build-system = [ rustPlatform.maturinBuildHook ];
build-system = [
setuptools
build
];
nativeBuildInputs = [
cargo
@@ -86,6 +79,7 @@ buildPythonPackage rec {
rustPlatform.cargoSetupHook
rustPlatform.cargoBuildHook
rustPlatform.cargoInstallHook
rustPlatform.maturinBuildHook
rustc
];
@@ -101,12 +95,8 @@ buildPythonPackage rec {
# https://discourse.nixos.org/t/nixpkgs-rustplatform-and-nightly/22870
RUSTC_BOOTSTRAP = true;
# Several `debug_assert!` statements use the unstable `Option::is_none_or` method
RUSTFLAGS = lib.concatStringsSep " " (
[
"-Cdebug_assertions=n"
]
++ lib.optionals (polarsMemoryAllocator.pname == "mimalloc") [
lib.optionals (polarsMemoryAllocator.pname == "mimalloc") [
"--cfg use_mimalloc"
]
);
@@ -117,24 +107,17 @@ buildPythonPackage rec {
maturinBuildFlags = [
"-m"
"py-polars/Cargo.toml"
"py-polars/runtime/polars-runtime-32/Cargo.toml"
];
postInstall = ''
# Move polars.abi3.so -> polars.so
local polarsSo=""
local soName=""
while IFS= read -r -d "" p ; do
polarsSo=$p
soName="$(basename "$polarsSo")"
[[ "$soName" == polars.so ]] && break
done < <( find "$out" -iname "polars*.so" -print0 )
[[ -z "''${polarsSo:-}" ]] && echo "polars.so not found" >&2 && exit 1
if [[ "$soName" != polars.so ]] ; then
mv "$polarsSo" "$(dirname "$polarsSo")/polars.so"
fi
# maturin builds `_polars_runtime_32`, and we also need the pure-python `polars` wheel itself
preBuild = ''
pyproject-build --no-isolation --outdir dist/ --wheel py-polars
'';
# Fails on polars -> polars-runtime-32 dependency between the two wheels
dontCheckRuntimeDeps = true;
pythonImportsCheck = [
"polars"
];
@@ -219,6 +202,7 @@ buildPythonPackage rec {
ps.nest-asyncio
ps.numpy
ps.openpyxl
ps.orjson
ps.pandas
ps.pyarrow
ps.pydantic
@@ -277,14 +261,16 @@ buildPythonPackage rec {
"test_scan_credential_provider"
"test_scan_credential_provider_serialization"
# Only connecting to localhost, but http URL scheme is disallowed
"test_scan_delta_loads_aws_profile_endpoint_url"
# ModuleNotFoundError: ADBC 'adbc_driver_sqlite.dbapi' driver not detected.
"test_read_database"
"test_read_database_parameterised_uri"
# Untriaged
"test_pickle_lazyframe_nested_function_udf"
"test_serde_udf"
"test_hash_struct"
"test_async_index_error_25209"
"test_parquet_schema_correctness"
];
disabledTestPaths = [
"tests/benchmark"
@@ -293,15 +279,11 @@ buildPythonPackage rec {
# Internet access
"tests/unit/io/cloud/test_credential_provider.py"
# Wrong altair version
"tests/unit/operations/namespaces/test_plot.py"
# adbc
"tests/unit/io/database/test_read.py"
# Untriaged
"tests/unit/cloud/test_prepare_cloud_plan.py"
"tests/unit/io/cloud/test_cloud.py"
# Requires pydantic 2.12
"tests/unit/io/test_iceberg.py"
];
installPhase = "touch $out";
@@ -38,14 +38,14 @@
buildPythonPackage rec {
pname = "sqlframe";
version = "3.43.7";
version = "3.43.8";
pyproject = true;
src = fetchFromGitHub {
owner = "eakmanrq";
repo = "sqlframe";
tag = "v${version}";
hash = "sha256-qrKNn13wFEqvMQYzHH8T1pga1EUaVIt701p0k4eXw9c=";
hash = "sha256-gsWA3aBolsR2zPwseHnQXSJRngXUHFGvi55UPevgUHw=";
};
build-system = [ setuptools-scm ];
@@ -19,14 +19,14 @@
buildPythonPackage rec {
pname = "sqlglot";
version = "27.28.1";
version = "27.29.0";
pyproject = true;
src = fetchFromGitHub {
repo = "sqlglot";
owner = "tobymao";
tag = "v${version}";
hash = "sha256-DGpxKIlSRwKKXhZGDTTQb8a3iAzy8a7h9/PKHPCuq+g=";
hash = "sha256-kqtsZRtIIgQ0cTbhG5K4N+c3cq7I+Uvd+3s+b0CYLtg=";
};
build-system = [