Skip to content

fix(ingestion): Pad sparse matrices to correct dimensions #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

giacomo-ciro
Copy link

This commit fixes a bug in ingestion.py where sparse matrices with null entries at the end were being read with incorrect dimensions.

Previously, the read_input_vectors function would convert a sparse matrix to a dense matrix without accounting for trailing null columns. This could lead to a mismatch in dimensions later in the code.

For example, a sparse array whose schema specified a shape of10x100 might be read as a 10x90 dense matrix if its last 10 columns were empty.

The fix adds a check to ensure the matrix is padded with zeros to the expected dimensions, preventing the dimension mismatch.

This commit fixes a bug in `ingestion.py` where sparse matrices with null entries at the end were being read with incorrect dimensions.

Previously, the `read_input_vectors` function would convert a sparse matrix to a dense matrix without accounting for trailing null columns. This could lead to a mismatch in dimensions later in the code, as a `10x100` sparse matrix might be read as a `10x90` dense matrix if its last 10 columns were empty.

The fix adds a check to ensure the matrix is padded with zeros to the expected dimensions, preventing the dimension mismatch.
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.

1 participant