Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

planframe-sparkless

Docs License: MIT

Sparkless adapter package for PlanFrame. Import as planframe_sparkless.

This package:

  • uses the PySpark-like UI from planframe.spark (SparkFrame)
  • executes plans using the sparkless engine (no JVM)

Documentation (ReadTheDocs):

  • Sparkless track (end users): https://planframe.readthedocs.io/en/latest/planframe_sparkless/

Install

pip install planframe-sparkless

Quickstart

from planframe.expr import add, col, lit
from planframe_sparkless import SparklessFrame


class User(SparklessFrame):
    id: int
    x: int


pf = User([{"id": 1, "x": 2}, {"id": 2, "x": 3}])

out = (
    pf.select("id", "x")
    .withColumn("x2", add(col("x"), lit(1)))
    .where(pf["x"] > lit(2))
    .select("id", "x2")
)

print(out.to_dicts())

Execution model (PlanFrame)

  • PlanFrame is always lazy: chaining does not execute backend work.
  • Materialization boundaries:
    • collect() returns list[pydantic.BaseModel]
    • collect_backend() returns the sparkless backend dataframe object
    • to_dicts() / to_dict() export rows/columns
    • Async: acollect() / ato_dicts() / ato_dict() (aliases: collect_async, to_dicts_async, to_dict_async)
  • Core v1.2.0+ (current minor v1.3.x): execute_plan_async, planframe.materialize, Expr == / & / … as IR, plus v1.3.0 adapter hooks—see Migrating since v1.1.0. This package requires planframe>=1.3.0 (see pyproject.toml on PyPI).

Notes / limitations

  • This adapter aims to support a practical subset of Spark-like operations using sparkless.
  • Row streaming: stream_dicts() currently materializes via to_dicts() (sparkless does not expose an efficient local iterator API yet).
  • For backend-agnostic semantics and supported transforms, see the core docs: https://planframe.readthedocs.io/en/latest/planframe/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

planframe_sparkless-0.2.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

planframe_sparkless-0.2.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file planframe_sparkless-0.2.1.tar.gz.

File metadata

  • Download URL: planframe_sparkless-0.2.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for planframe_sparkless-0.2.1.tar.gz
Algorithm Hash digest
SHA256 eb3382077af228eeb74f695e68e23dc84e8c855387b5023f267e2a5b52b926ef
MD5 b5f088980a94905ecc96a8e42ff99320
BLAKE2b-256 0a4c1d08a66f21b42c04cf208170a2baa32d83ac3af7cd9584f1ff69c5ac3114

See more details on using hashes here.

File details

Details for the file planframe_sparkless-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for planframe_sparkless-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 060bfde849a84c6cb8f0544bddc37276147201610dff3ae6166f412b2eeec106
MD5 82eb3b464d6d9566fc1a09f1003c2752
BLAKE2b-256 5803d3067adc45b45c2b2916a905b4bf88ea9d3dab5dfc72382e2447bea01fcb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page