We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
>>> pl.DataFrame({'a': [True, False], 'b': [1, 2]}).select(pl.when('a').then(pl.col.b)) b 1 null shape: (2, 1) >>> pl.DataFrame({'a': [True, False], 'b': [1, 2]}).select(pl.when('a').then(-pl.col.b)) literal -1 null shape: (2, 1) >>> pl.when('a').then(-pl.col.b).meta.output_name() 'b'
No response
pl.when('a').then(-pl.col.b) creates a column called "literal", even though its meta.output_name() is "b".
The column name should be "b", no?
--------Version info--------- Polars: 0.19.3 Index type: UInt32 Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17 Python: 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:34:09) [GCC 12.3.0] ----Optional dependencies---- adbc_driver_sqlite: <not installed> cloudpickle: <not installed> connectorx: <not installed> deltalake: <not installed> fsspec: <not installed> gevent: <not installed> matplotlib: 3.8.0 numpy: 1.26.0 pandas: 2.1.1 pyarrow: 13.0.0 pydantic: <not installed> sqlalchemy: <not installed> xlsx2csv: 0.8.1 xlsxwriter: 3.1.4
The text was updated successfully, but these errors were encountered:
This maybe already fixed in main branch.
Sorry, something went wrong.
Can confirm that this was fixed by #11158; will be in the upcoming 0.19.4 👍
0.19.4
No branches or pull requests
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
pl.when('a').then(-pl.col.b) creates a column called "literal", even though its meta.output_name() is "b".
Expected behavior
The column name should be "b", no?
Installed versions
The text was updated successfully, but these errors were encountered: