Repository navigation
ENH: serialize scipy sparse arrays (sparray / dok_array) - #9370
charan-rathore wants to merge 1 commit into
Conversation
The spmatrix classes are deprecated in favour of sparse arrays, which do not inherit from spmatrix and previously had no serialization handlers registered, so transmitting them failed with "TypeError: Could not serialize object of type ...". Register generic dask serialization for scipy.sparse.sparray and add dok_array handlers mirroring the dok_matrix ones. Parametrize the scipy protocol tests over both legacy matrix and modern array types. Fixes #9353 Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 40 files ± 0 40 suites ±0 14h 8m 30s ⏱️ - 6m 26s For more details on these failures, see this check. Results for commit 03d882a. ± Comparison against base commit dc182bd. |
|
CI verdict on the 3 failures: all three are known flakes, unrelated to this change.
This PR only touches scipy sparse serialization and its protocol tests; those files are untouched by the failures above, and the full scipy protocol suite (matrix + array classes) passes. Nothing to change on my side. |
|
Closing this one. It hasn't had maintainer traction since I opened it and I'm focusing my effort elsewhere. Happy to revisit if there's interest. |
Closes #9353
The spmatrix classes are deprecated in favour of sparse arrays, and the array types don't inherit from spmatrix, so they currently get no serialization handlers - transmitting a
dok_array(or any other sparray) fails withTypeError: Could not serialize object of type dok_array. This is what reds the nightly CI (14 failures indistributed/protocol/tests/test_scipy.py).This registers generic dask serialization for
scipy.sparse.sparrayand addsdok_arrayhandlers mirroring thedok_matrixones, and parametrizes the scipy protocol tests over both the legacy matrix classes and the modern array classes.Verified locally: without the
scipy.pychange the new array parametrizations fail 14/28; with it, 28/28 pass. Ruff clean.pixi run lint(ran ruff directly on the two changed files - clean; no pixi on this machine)