The pre_transform_extract method generates a transformed Vega specification similar to pre_transform_spec, but with a key difference: instead of inlining the transformed datasets directly into the specification, it returns the datasets separately in Apache Arrow table format.
This pattern is recommended when dealing with large datasets. By extracting the data from the spec, you can transmit the specification and the data independently, which is often more efficient when using the Arrow format for large-scale data transfer.
# Conceptual usage in Python
# The method is available on the VegaFusionRuntime class
# transformed_spec: The Vega spec with data references
# extracted_datasets: A collection of datasets in Arrow format
transformed_spec, extracted_datasets = runtime.pre_transform_extract(spec)