You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Reproducible example
df=pl.DataFrame(
{
"a": [1, 2],
"b": [None, None],
}
)
# this DataFame has unequal column lengths (1 and 0) but CAN be createddf2=df.select(
pl.all().drop_nulls().first().name.suffix("_first"),
)
# printing panicsprint(df2) # PanicException: The column lengths in the DataFrame are not equal.# but can still work with itdf2.with_columns(
pl.all().len()
)
shape: (1, 2)
┌─────────┬─────────┐
│ a_first ┆ b_first │
│ --- ┆ --- │
│ u32 ┆ u32 │
╞═════════╪═════════╡
│ 1 ┆ 0 │
└─────────┴─────────┘
Log output
No response
Issue description
It is possible to create an (invalid?) DataFrame with different column lengths.
Should this be possible?
Expected behavior
It should not be possible to create/calculate a DataFrame with different column lengths.
I think the cause for this is probably (almost) always that some functions return a zero-sized DataFrame which is somehow accepted and not broadcasted correctly? (I came across this when looking into #12363 where first/last return 0-size dfs)
Installed versions
0.19.12
The text was updated successfully, but these errors were encountered:
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Reproducible example
Log output
No response
Issue description
It is possible to create an (invalid?) DataFrame with different column lengths.
Should this be possible?
Expected behavior
It should not be possible to create/calculate a DataFrame with different column lengths.
I think the cause for this is probably (almost) always that some functions return a zero-sized DataFrame which is somehow accepted and not broadcasted correctly? (I came across this when looking into #12363 where
first/last
return 0-size dfs)Installed versions
The text was updated successfully, but these errors were encountered: