fix(fast-path): preserve Arrow type when building new-column table#44
Merged
universalmind303 merged 1 commit intoJul 4, 2026
Merged
Conversation
0c36449 to
7b935c2
Compare
This was referenced Jul 3, 2026
pa.array(s.to_pylist()) loses type information: fixed_size_list<float32>[N] becomes list<double> because Python floats are float64 and list structure is inferred from Python lists. Use s.to_arrow().combine_chunks() to preserve the declared daft return type exactly. Fixes daft-engine#40
d1a51e3 to
7ab5e52
Compare
universalmind303
approved these changes
Jul 4, 2026
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.
Fixes #40
Problem
FastPathFragmentWriterbuilt the new-column Arrow table via:pa.array(s.to_pylist())loses Arrow type information. Python floats are alwaysfloat64and Python lists carry no fixed-size constraint, sofixed_size_list<item: float>[N](e.g. an embedding vector from a@daft.func.batch(return_dtype=DataType.fixed_size_list(DataType.float32(), 128))UDF) was silently widened tolist<item: double>. Lance then commits the wrong type in the schema.Fix
Use
s.to_arrow().combine_chunks()instead, which preserves the Arrow type that daft declared in the UDF'sreturn_dtype.Test
TestRegressions::test_fixed_size_list_float32_type_preserved— creates a UDF returningfixed_size_list<float32>[8], merges via fast path, and asserts the Lance schema preserves the type and values are non-null.