Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: SQL "IN" stopped working at v0.19.8 #11946

Closed
2 tasks done
svaningelgem opened this issue Oct 23, 2023 · 1 comment · Fixed by #11947
Closed
2 tasks done

Regression: SQL "IN" stopped working at v0.19.8 #11946

svaningelgem opened this issue Oct 23, 2023 · 1 comment · Fixed by #11947
Labels
bug Something isn't working rust Related to Rust Polars

Comments

@svaningelgem
Copy link
Contributor

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

import polars as pl


df = pl.LazyFrame(
    [
        {"i1": 1},
        {"i1": 2},
        {"i1": 3},
    ]
)

ctx = pl.SQLContext(frame_data=df, eager_execution=False)
print(
    ctx.execute(f"SELECT * FROM frame_data WHERE i1 in (1, 3)", eager=False).collect()
)

Log output

Traceback (most recent call last):
  File "C:\Users\je70082\AppData\Roaming\JetBrains\IntelliJIdea2022.2\scratches\scratch_13.py", line 17, in <module>
    ctx.execute(f"SELECT * FROM frame_data WHERE i1 in (1, 3)", eager=False).collect()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\APPS\Anaconda3\envs\consumer_feed\Lib\site-packages\polars\sql\context.py", line 274, in execute
    res = wrap_ldf(self._ctxt.execute(query))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
polars.exceptions.ComputeError: Unary op None not supported for numeric SQL value

Issue description

The IN operator stopped behaving at version 0.19.8. Last version where this worked as expected was v0.19.7

Expected behavior

To get an output like this:

shape: (2, 1)
┌─────┐
│ i1  │
│ --- │
│ i64 │
╞═════╡
│ 1   │
│ 3   │
└─────┘

Installed versions

--------Version info---------
Polars: 0.19.11
Index type: UInt32
Platform: Windows-10-10.0.19044-SP0
Python: 3.11.5 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:26:23) [MSC v.1916 64 bit (AMD64)]

----Optional dependencies----
adbc_driver_sqlite:
cloudpickle:
connectorx:
deltalake:
fsspec: 2023.9.2
gevent:
matplotlib:
numpy: 1.26.0
openpyxl:
pandas: 2.1.1
pyarrow: 11.0.0
pydantic: 2.4.2
pyiceberg:
pyxlsb:
sqlalchemy:
xlsx2csv:
xlsxwriter:

@svaningelgem svaningelgem added bug Something isn't working rust Related to Rust Polars labels Oct 23, 2023
@reswqa
Copy link
Collaborator

reswqa commented Oct 23, 2023

Thanks for reporting this. This should be caused by #11574. I will fix this asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rust Related to Rust Polars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants