Игрушечный пример будет выглядеть примерно так;
Код: Выделить всё
import polars as pl
# pipeline definition
empty_lf = pl.LazyFrame()
step1_lf = base_lf.with_columns(pl.col('a') + 1)
step2_lf = step1_lf.filter(pl.col('a') > 2)
serialized_pipeline = step2_lf.serialize()
# pipeline execution (not necessarily performed in the same environment as definition)
actual_data = pl.LazyFrame({'a':[1,2,3]})
# this next line of code is fanciful. It is valid code, but it executes the lazy plan on the
# empty_lf above instead of actual_data, resulting in a ColumnNotFoundError
processed_data = actual_data.deserialize(io.BytesIO(serialized_pipeline)).collect()
Я что-то упускаю? Есть ли реальный способ сделать это? Происходит ли что-то под капотом, что делает такую операцию невозможной?