Fix multi-partition error when using pre_transform_spec #124
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.
This PR fixes an error that cropped up when using
pre_transform_spec
from Python with more then 8096 elements (the partition size that VegaFusion uses).A test to catch one particular manifestation of the error is added in
test_pretransform_multi_partition.py
. The issue seems related to using the zero-copy interface from Python/PyArrow to Rust/arrow-rs and then serializing the resulting RecordBatches into the arrow IPC format. It is potentially related to apache/arrow-rs#390.This PR removes the use of the zero-copy interface and instead serializes the PyArrow table to bytes in Python and deserializes in Rust. It also refactors the VegaFusion internals to remove a prior IPC serialization step, so there shouldn't be an appreciable difference in memory usage or performance. Once we have time to more fully diagnose the issue with the zero-copy interface, it would obviously be advantageous to re-adopt this interface.