Repository navigation
ENH: serialize scipy sparse arrays (sparray / dok_array) - #9370
Open
charan-rathore wants to merge 1 commit into
Open
charan-rathore wants to merge 1 commit into
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 dask#9353 Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
Contributor
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. |
Author
|
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. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)