SQL query with WHERE clause that evaluates to true/false gives ShapeError on DataFrame with null columns #18786
Labels
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
Checks
Reproducible example
Log output
Issue description
This is a follow-up to #18373. I commented there as well, however, since then I encountered what I described there in our application. I.e. there is a
WHERE
clause of the form'a' = 'a' OR 'b' = 'c'
I would like to use, but I get theShapeError
above.Note, that this still only happens when there are
null
columns in the DataFrame.My crude understanding of the situation is that these
WHERE
clauses are parsed down to essentiallypl.lit(True)
/pl.lit(False)
byparse_sql_expr
, and the same behavior can be observed in the following:This example works for DataFrames where there are no
null
columns. In versions prior to 1.0, this worked fine even withnull
columns.Expected behavior
I get the same DataFrame when the
WHERE
clause evaluates totrue
, and an empty DataFrame when it evaluates tofalse
.Installed versions
The text was updated successfully, but these errors were encountered: