Skip to content

fix(index): error on non-fsl input in NormalizeTransformer - #9393

Open
LuciferYang wants to merge 3 commits into
lance-format:mainfrom
LuciferYang:fix/ivf-rq-normalize-fsl-error
Open

LuciferYang wants to merge 3 commits into
lance-format:mainfrom
LuciferYang:fix/ivf-rq-normalize-fsl-error

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

Closes #9392

NormalizeTransformer::transform errored when its column was missing and then panicked if the column was the wrong type, because the downcast used as_fixed_size_list(). The column is named by string on a public transformer, so the type is the caller's to get wrong. It now uses the _opt variant and reports the column and the type it found, which is what KeepFiniteVectors in the same file already does for its own column.

How was this patch tested?

test_normalize_transformer_rejects_non_fsl_column points the transformer at a Float32 column and asserts the error names the problem; it mirrors the existing test_keep_finite_vectors_rejects_non_list_column. With the panicking downcast restored the test panics inside arrow::array::cast instead.

NormalizeTransformer downcast the input with as_fixed_size_list, which
panics for non-fixed-size-list columns, while sibling KeepFiniteVectors
in the same file returns a descriptive Error::index for the same input.
Match the sibling's error contract.

Assisted-by: GLM-5.3
@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer bug Something isn't working labels Sep 18, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gate recommendation: approve.

This change closes the caller-controlled type boundary by returning a contextual Error::Index instead of allowing Arrow’s fixed-size-list downcast to panic. The focused wrong-type regression test passes, as do the existing normalization tests for fixed-size-list inputs and output-column mode.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-index Vector index, linalg, tokenizer bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: NormalizeTransformer panics when its column is not a fixed-size list

1 participant