Skip to content
SparquetSparquet

Where pipelines run

Sparquet is a library. Wherever PySpark runs, it runs — and the session manager adapts to the environment it finds.

Environment Session The spark block
Databricks reuses the active session ignored
EMR / Dataproc / Synapse built with your configs configs applied, master ignored
Local built with your configs fully applied, including master

The session is a process-wide singleton: the first Sparquet creates it and every later pipeline shares it. That is what makes running many pipelines in one job cheap, and what lets them hand data to each other through temp views.

from sparquet import Sparquet
fw = Sparquet(spark={"app_name": "dev", "master": "local[*]"})
print(fw.run("pipelines/orders.json").summary())
fw.stop()

Good for development and tests. On Windows, Spark needs winutils.exe and HADOOP_HOME before it can touch the local filesystem.

The JSON files are code — version them with everything else.

repo/
├── pipelines/
│ ├── orders.json
│ ├── customers.json
│ └── shared/
│ └── standard_filters.json
├── jobs/
│ └── run_daily.py
└── tests/
└── test_pipelines.py

Because a pipeline is data, it is testable without a cluster: parse every file in CI and fail on the ones that do not, then run the small ones against sample data.

import json, pathlib
from sparquet.core.config import PipelineConfig
def test_every_pipeline_parses():
for path in pathlib.Path("pipelines").glob("*.json"):
PipelineConfig.from_dict(json.loads(path.read_text(encoding="utf-8")))

Sparquet runs a pipeline; it does not decide when. Any scheduler works, because the entry point is a normal Python process:

Terminal window
python -m sparquet.cli pipelines/orders.json
# Airflow
PythonOperator(
task_id="orders",
python_callable=lambda **ctx: run_pipeline(
"pipelines/orders.json", since=ctx["data_interval_start"].isoformat()
),
)

Branch on the result rather than on exceptions — PipelineResult never raises:

result = fw.run(config, params=params)
if result.skipped:
return "nothing to do"
if not result.success:
raise AirflowFailException(result.error)

Connector packages are declared in the file, which keeps a job self-describing:

{ "spark": { "configs": { "spark.jars.packages": "io.delta:delta-spark_2.12:3.2.0" } } }

On a shared cluster, installing the package as a cluster library is faster — it is not resolved on every run.

Every log line is a JSON object on stderr, which drops straight into Datadog, CloudWatch or Splunk with no parser:

{"timestamp":"2026-01-15T03:00:12.918Z","level":"INFO","message":"Pipeline finished","pipeline":"orders_curated","rows_written":41233}

Alert on level: ERROR and on validation failures from the report table — those two cover the failure modes that matter.