Skip to main content

joblibspark-fabric

An independently maintained fork of joblib-spark that provides an Apache Spark backend for joblib. Releases are maintained in thinkall/joblib-spark-fabric, independently of upstream. The distribution name is joblibspark-fabric; the Python namespace remains joblibspark, including register_spark() and the 'spark' backend name.

The upstream Apache-2.0 license and attribution are retained; fork changes are recorded in CHANGES.rst.

Installation

Minimum requirements: Python 3.13, joblib 1.5.0, and PySpark 4.0. The tested range currently extends through Python 3.14 and PySpark 4.3.0, for both classic Spark and Spark Connect.

Use mutually compatible versions: Python 3.14 requires PySpark 4.1 or newer and a joblib release that supports Python 3.14.

Do not install joblibspark and joblibspark-fabric together: both provide the same import namespace. To migrate an existing environment:

python -m pip uninstall joblibspark
python -m pip install joblibspark-fabric

The base installation deliberately does not install or replace PySpark in managed environments such as Fabric. If PySpark is not already installed, use an extra:

python -m pip install "joblibspark-fabric[spark]"
# Spark Connect, including its pandas, Arrow, and gRPC dependencies:
python -m pip install "joblibspark-fabric[connect]"

Install scikit-learn separately if you use the examples below.

Examples

Run following example code in pyspark shell:

from joblib import parallel_backend
from sklearn.model_selection import cross_val_score
from sklearn import datasets
from sklearn import svm
from joblibspark import register_spark

register_spark() # register spark backend

iris = datasets.load_iris()
clf = svm.SVC(kernel='linear', C=1)
with parallel_backend('spark', n_jobs=3):
  scores = cross_val_score(clf, iris.data, iris.target, cv=5)

print(scores)

Development and releases

python -m pip install -e ".[test,connect]" scikit-learn build twine
python -m pytest test
python -m pylint joblibspark
python -m build
python -m twine check dist/*

CI uses one explicit matrix: Python 3.13 with Spark 4.0-4.3, plus Python 3.14 with Spark 4.3. The Spark 4.0 baseline pins joblib 1.5.0; other combinations use a current joblib >=1.5.0. Every combination runs in classic and Connect modes, without exclusions. Integration tests use Java 21 and local Spark clusters; the simulated GPU resource tests require Linux. To run Connect tests, set TEST_SPARK_CONNECT=true.

Containerized cluster tests

An additional CI job runs one standalone master, three worker containers (one single-core executor per worker), and a separate driver. Connect tests also use a separate Spark Connect server container. Tests require tasks to rendezvous across three distinct executor hostnames, check driver filesystem isolation, perform a cross-worker shuffle, and verify joblib failure recovery.

The minimum and newest supported runtime combinations run in both modes. All containers share one GitHub runner, so this verifies container/network isolation, not separate physical machines or real GPU computation. The existing TestSimulatedGPUResources tests use synthetic GPU addresses and only verify Spark resource scheduling; they do not require or test GPU hardware.

With Docker Compose installed, run the classic minimum-runtime case with:

docker compose -f test/containers/compose.yml build master
docker compose -f test/containers/compose.yml up -d --wait --scale worker=3 master worker
docker compose -f test/containers/compose.yml run --rm --use-aliases driver
docker compose -f test/containers/compose.yml down --volumes --remove-orphans

Releases publish to the separate joblibspark-fabric project on PyPI using Trusted Publishing, without an upstream release or a stored API token:

  1. Enable GitHub Actions on the fork. Configure a PyPI pending publisher for project joblibspark-fabric, GitHub owner thinkall, repository joblib-spark-fabric, workflow release.yml, and environment pypi. Configure approval protection for that GitHub environment.
  2. Update joblibspark.__version__ and CHANGES.rst.
  3. Publish a GitHub release with a matching tag, such as v0.7.1. The release workflow checks the version, runs CI, builds the distributions, and publishes only after the pypi environment is approved.

Limitations

joblibspark does not generally support run model inference and feature engineering in parallel. For example:

from sklearn.feature_extraction import FeatureHasher
h = FeatureHasher(n_features=10)
with parallel_backend('spark', n_jobs=3):
    # This won't run parallelly on spark, it will still run locally.
    h.transform(...)

from sklearn import linear_model
regr = linear_model.LinearRegression()
regr.fit(X_train, y_train)

with parallel_backend('spark', n_jobs=3):
    # This won't run parallelly on spark, it will still run locally.
    regr.predict(diabetes_X_test)

Note: for sklearn.ensemble.RandomForestClassifier, there is a n_jobs parameter, that means the algorithm support model training/inference in parallel, but in its inference implementation, it bind the backend to built-in backends, so the spark backend not work for this case.

Metadata

Release files for joblibspark-fabric 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for joblibspark-fabric 0.7.1
File Size Uploaded Provenance Actions
joblibspark_fabric-0.7.1.tar.gz 25.2 kB With provenance Details for joblibspark_fabric-0.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for joblibspark-fabric 0.7.1
File Interpreter ABI Platform Actions
joblibspark_fabric-0.7.1-py3-none-any.whl Python 3 none any Details for joblibspark_fabric-0.7.1-py3-none-any.whl

Total release size: 39.9 kB

Release files / joblibspark_fabric-0.7.1.tar.gz

Download URL joblibspark_fabric-0.7.1.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
70c11fff365c714ff1532b6afd703aa5b9d439236695cc02e3e836a14be0b7b4
BLAKE2b-256 checksum
How to use checksums
fd82e29c8a26dea6dd71ebbce18f1cd4fa54ee45d4a9572d120ef6583c4db1ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Release files / joblibspark_fabric-0.7.1-py3-none-any.whl

Download URL joblibspark_fabric-0.7.1-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f064c9df0699a249c8b87993a5987b97971381497b7fd5b51f2b7bad59146dfa
BLAKE2b-256 checksum
How to use checksums
5f69817689ff5549df988ac41227883f7acf5b8069a9fb180bca3d6bd6768227
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Security for joblibspark-fabric 0.7.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for joblibspark_fabric-0.7.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page