Polars legacy hash
For a specific project, I needed to preserve the hashing behaviour of polars 0.20.10 (or the underlying ahash 0.8.7), whilst also wanting to upgrade polars itself.
For now this plugin specifically caters to 0.20.10, but in principle could be generalised. See also Polars Hash which is a more general solution to this, which is coupled to a specific point in time in the history of polars. If there ever comes a use case for this, I expect to move to some version of versioning akin to stub libraries e.g. 0.20.10.20250415 and deploy these from seperate branches to avoid having to bundle multiple polars binaries into the same wheel.
Installation
pip install polars_legacy_hash in your virtualenv. Note that you'll need to install polars seperately. This package doesn't depend on polars explicitly, so that if you use e.g. polars-u64-idx we won't pull in polars as well (TODO double check this works as intended)
Usage
The best way to explain what this package does it to demonstrate:
# /// script
# requires-python = ">=3.8"
# dependencies = [
# "polars==0.20.10",
# "polars_legacy_hash",
# ]
# ///
import polars as pl
import polars_legacy_hash as plh
print(f"Hashing with polars={pl.__version__} directly:")
s = pl.Series([42])
print(s.hash().item())
print("Using polars_legacy_hash:")
result = s.to_frame("test").select(plh.legacy_hash(pl.col("test"))).to_series()
print(result.item())
Running this with uv run --script examples/polars_0.20.10.py produces this:
Hashing with polars=0.20.10 directly:
3146795401079207122
Using polars_legacy_hash:
3146795401079207122
Running the analogous uv run --script examples/polars_1.27.1.py we get:
Hashing with polars=1.27.1 directly (not consistent!):
16588070273457376249
Using polars_legacy_hash:
3146795401079207122
i.e. we get the same consistent output, in spite of the polars version change.
For correctness checking, the CI runs test_expectations.py under polars 0.20.10 to
confirm that the test values in the fixtures (defined in tests/conftest.py) are consistent with polars itself from that version.
Known limitations
- No support for polars categorical
Development
The plugin is built with maturin, and uv is setup to rebuild an editable install whenever the rust part of the plugin changes. This means the simplest way to run the tests is
uv run pytest -rP
Metadata
Release files for polars-legacy-hash 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polars_legacy_hash-0.0.5.tar.gz | 36.4 kB | Without provenance | Details for polars_legacy_hash-0.0.5.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| polars_legacy_hash-0.0.5-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details for polars_legacy_hash-0.0.5-cp38-abi3-win_amd64.whl |
| polars_legacy_hash-0.0.5-cp38-abi3-win32.whl | CPython 3.8 | abi3 | Windows x86-32 | Details for polars_legacy_hash-0.0.5-cp38-abi3-win32.whl |
| polars_legacy_hash-0.0.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details for polars_legacy_hash-0.0.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| polars_legacy_hash-0.0.5-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details for polars_legacy_hash-0.0.5-cp38-abi3-macosx_11_0_arm64.whl |
| polars_legacy_hash-0.0.5-cp38-abi3-macosx_10_12_x86_64.whl | CPython 3.8 | abi3 | macOS 10.12+ x86-64 | Details for polars_legacy_hash-0.0.5-cp38-abi3-macosx_10_12_x86_64.whl |
Total release size: 19.7 MB
Release files / polars_legacy_hash-0.0.5.tar.gz
| Download URL | polars_legacy_hash-0.0.5.tar.gz |
|---|---|
| Size | 36.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfc0795b9c9045b4ced005bcfb13536e52f960d2f4ce82a5d312c26150d37816
|
|
BLAKE2b-256 checksum How to use checksums |
5fb82451b8ba068d4094637f7a7027e2cf6166f03ccf7baca461be3584f01759
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.8.3
|
Release files / polars_legacy_hash-0.0.5-cp38-abi3-win_amd64.whl
| Download URL | polars_legacy_hash-0.0.5-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e0ed1d85b4534a6b00e821a8574137dc566f21c0a949fd15db1751bc9f3588f7
|
|
BLAKE2b-256 checksum How to use checksums |
82c83726df10b628e9ca78d5c42938d75fa55c4f9154be97a8479b39e1147207
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.8.3
|
Release files / polars_legacy_hash-0.0.5-cp38-abi3-win32.whl
| Download URL | polars_legacy_hash-0.0.5-cp38-abi3-win32.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
5ae5520f6bc2dde82f934cf60bd5d996c4639e9c502d524f916ddd5d407c3b1d
|
|
BLAKE2b-256 checksum How to use checksums |
22ad7bbffc585d4eb6f687ca9bf74aa8dcada250907e6ff2d0137306e8f5096b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.8.3
|
Release files / polars_legacy_hash-0.0.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | polars_legacy_hash-0.0.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.7 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
63da3f67be4e5f13feb63aa663a3d26675d970b9f423e1ff8f48532d30256f39
|
|
BLAKE2b-256 checksum How to use checksums |
440684ec79337841ace7266012dd5773e2d1ab21be30fc82926b9a9f221691c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.8.3
|
Release files / polars_legacy_hash-0.0.5-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | polars_legacy_hash-0.0.5-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
26f165aaf083d58154915fdfb6a41440b23b55c950619d02422ae641013e6745
|
|
BLAKE2b-256 checksum How to use checksums |
959c3d63f77f5bf5be23392605c555c4bd6730ca93b176888397f49edfea077f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.8.3
|
Release files / polars_legacy_hash-0.0.5-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | polars_legacy_hash-0.0.5-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
3543849c1c32a4241c214983a21b43327b19ae83acc38afcc289d1198cbb4b41
|
|
BLAKE2b-256 checksum How to use checksums |
314e37dcd3cbb14d1718e918d11935878b34645e34bbbea980105777e693c3b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.8.3
|
Security for polars-legacy-hash 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.