Polars backend adapter for PlanFrame.
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
planframe-polars
Polars adapter package for PlanFrame. Import as planframe_polars.
Usage
import polars as pl
from dataclasses import dataclass
from planframe_polars import PolarsFrame
@dataclass(frozen=True)
class UserSchema:
id: int
age: int
lf = pl.DataFrame({"id": [1], "age": [2]}).lazy()
class User(PolarsFrame):
id: int
age: int
pf = User(lf)
df = pf.select("id").collect()
# Or construct from python data:
pf2 = User({"id": [1], "age": [2]})
Execution model
PlanFrame is always lazy:
- Chaining methods (like
.select(...)) does not run Polars operations. collect()evaluates the full plan. If the source is apolars.LazyFrame, this naturally compiles into a single lazy query before collecting.
Notes (Polars-specific)
- Pivot:
LazyFrame.pivot(...)requireson_columnsto be provided up-front (Polars must know the output schema prior tocollect()). PlanFrame enforces this at execution time. - concat_vertical: implemented via
polars.concat(..., how="vertical"). - Join: implemented via
LazyFrame.join(...)/DataFrame.join(...)with symmetriconor asymmetricleft_on/right_on, plus optionalJoinOptionsmapped to Polars (nulls_equal,validate,coalesce,maintain_order,allow_parallel/ streaming).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file planframe_polars-0.2.0.tar.gz.
File metadata
- Download URL: planframe_polars-0.2.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85c0ddf746682f7d32d83f70b143f83f481263d68847b4bb11a33a5e4d7d12f4
|
|
| MD5 |
bf165ca0d541c81f62beaf883fba6cc0
|
|
| BLAKE2b-256 |
e558990a5a7564706f875ff1457325cb3ebc3293c5aeff12ca132932a6ed01d5
|
File details
Details for the file planframe_polars-0.2.0-py3-none-any.whl.
File metadata
- Download URL: planframe_polars-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8196f7d510b5429085d356782765dcd9efa09a6b411ac0f07941f25cfcbbd9a4
|
|
| MD5 |
fae4df24348f4388cfeffaeb4813066b
|
|
| BLAKE2b-256 |
b1b4c8d3e635c57b081a172d08b0d6b91e5b332255fc45c8845abe27e7d30b42
|