Skip to content

Fix discarded return value from sp_matrix.tocsc() - #317

Closed
ThinkerDesigns wants to merge 2 commits into
amzn:mainlinefrom
ThinkerDesigns:fix-tocsc-return-value
Closed

ThinkerDesigns wants to merge 2 commits into
amzn:mainlinefrom
ThinkerDesigns:fix-tocsc-return-value

Conversation

@ThinkerDesigns

Copy link
Copy Markdown

In get_sub_tree_chain(), sub_leaf_cluster.tocsc() was called but the returned matrix was not assigned back to the variable. This means the format conversion is silently ignored, and subsequent operations may operate on an incorrectly-formatted sparse matrix.

Changed:
sub_leaf_cluster.tocsc()
to:
sub_leaf_cluster = sub_leaf_cluster.tocsc()

This ensures the CSC-format conversion actually takes effect before the matrix is sliced.

Fixes a silent correctness bug in distributed clustering.

In get_sub_tree_chain(), sub_leaf_cluster.tocsc() was called but the
returned matrix was not assigned back to the variable. This means the
format conversion is silently ignored, and subsequent operations may
operate on an incorrectly-formatted sparse matrix.

Changed:
    sub_leaf_cluster.tocsc()
to:
    sub_leaf_cluster = sub_leaf_cluster.tocsc()

This ensures the CSC-format conversion actually takes effect before the
matrix is sliced.
In _train_sub_models(), sub_Y.tocsc() was called but the returned matrix
was not assigned back to the variable. The CSC format conversion is now
properly captured.
Copilot AI lite review requested due to automatic review settings August 16, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ThinkerDesigns ThinkerDesigns closed this by deleting the head repository Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants