A previous release had provenance metadata, but this release does not. View details.
polars_cache
A lightweight, lazy, disc-based cache for Polars LazyFrames.
Usage
import polars as pl
import polars_cache as pc
lf = pl.LazyFrame({"x" : range(100)})
def very_expensive(col: str):
pl.col(col).pow(2).exp().sqrt()
query = (
lf
.with_columns(very_expensive("x"))
.pipe(pc.cache_to_disc, max_age=120) # set up cache
)
df1 = query.collect() # populate the cache
df2 = query.collect() # second invocation will be much faster!
# do some downstream computation
another_query = query.with_columns(y = pl.col("x") + 7)
df3 = another_query.collect() # this will use the cache!
Updating a source will cause the cache to refresh:
import os
query_from_a_file = (
pl.scan_parquet("data.parquet")
.group_by("age", "sex")
.agg(pl.len())
.pipe(pc.cache_to_disc, check_sources=True)
)
_ = query_from_a_file.collect() # populate cache
result = query_from_a_file.collect() # load from cache
os.utime("data.parquet") # update source timestamp
new_result = query_from_a_file.collect() # cache is invalid -- will refresh
⚠️ Warning ⚠️
This function is opaque to the Polars optimizer and will split your query into two chunks: one before the cache statment and one after. Each query will be independently optimzed by Polars, but optimizations (e.g. projection and predicate pushdown) will NOT be able to cross the cache barrier. Use with caution.
Metadata
Release files for polars-cache 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Loss of provenance
These files do not have provenance metadata, despite files in a prior release including this data.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polars_cache-1.0.5.tar.gz | 20.5 kB | Without provenance | Details for polars_cache-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polars_cache-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for polars_cache-1.0.5-py3-none-any.whl |
Total release size: 24.1 kB
Release files / polars_cache-1.0.5.tar.gz
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | polars_cache-1.0.5.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5999acd98a04f6a392aae28cb1085cc3aa1e22156ca640ad74bbec0c655c1e0e
|
|
BLAKE2b-256 checksum How to use checksums |
cab46f791898872e2a10f9cac17e0b2a0fdf98449c79fe09745c1f1bcb142de4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.3
|
Release files / polars_cache-1.0.5-py3-none-any.whl
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | polars_cache-1.0.5-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b7b530eaaf918d7689864a8c89d85f126286f36396e2cb34228a6bf8da7195f
|
|
BLAKE2b-256 checksum How to use checksums |
0385ee6e874719ee1198d5a8d1323a149335f2cd4498a2b39c858e944370025a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.3
|
Security for polars-cache 1.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.
Loss of provenance
A previous release of these files had provenance metadata, but this release does not.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Release comparison
- Removed 1.0.4 2 files With provenance
- Added 1.0.5 2 files Without provenance
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.