Error when trying to concatenate LazyFrames horizontally in python polars
I am trying to concatenate two LazyFrames horizontally in python polars and get an error. Here is the code:
import polars as pl
df_h1 = pl.DataFrame({"l1": [1, 2], "l2": [3, 4]}).lazy()
df_h2 = pl.DataFrame({"r1": [5, 6], "r2": [7, 8], "r3": [9, 10]}).lazy()
pl.concat([df_h1, df_h2], how="horizontal")
I get the error:
ValueError: LazyFrame `how` must be one of {'vertical', 'vertical_relaxed', 'diagonal', 'diagonal_relaxed', 'align'}, got 'horizontal'
The code works for polars DataFrames, i.e., if you just remove the .lazy methods in the above code. The documentation says it should work for LazyFrames. For example, doing diagonal concatenation on LazyFrames seems to work fine for me:
df_h1 = pl.DataFrame({"l1": [1, 2], "l2": [3, 4]}).lazy()
df_h2 = pl.DataFrame({"r1": [5, 6], "r2": [7, 8], "r3": [9, 10]}).lazy()
pl.concat([df_h1, df_h2], how="diagonal")
Note: I have polars version 0.19.12.