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

Expr.slice no longer allows length = None #17365

Closed
2 tasks done
cmdlineluser opened this issue Jul 2, 2024 · 1 comment · Fixed by #17372
Closed
2 tasks done

Expr.slice no longer allows length = None #17365

cmdlineluser opened this issue Jul 2, 2024 · 1 comment · Fixed by #17372
Labels
bug Something isn't working P-high Priority: high python Related to Python Polars regression Issue introduced by a new release
Milestone

Comments

@cmdlineluser
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.DataFrame({"foo": [1, 2, 3]})

df.select(pl.all().slice(1))
# InvalidOperationError: length must be integral for slice, not null

Log output

No response

Issue description

Previously, if no length was provided, all following rows would be selected.

If set to None, all rows starting at the offset will be selected.

Expected behavior

>>> df.select(pl.all().slice(1, pl.len()))
shape: (2, 1)
┌─────┐
│ foo │
│ --- │
│ i64 │
╞═════╡
│ 2   │
│ 3   │
└─────┘

Installed versions

--------Version info---------
Polars:               1.0.0
Index type:           UInt32
Platform:             macOS-13.6.1-arm64-arm-64bit
Python:               3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               <not installed>
gevent:               <not installed>
great_tables:         <not installed>
hvplot:               <not installed>
matplotlib:           <not installed>
nest_asyncio:         <not installed>
numpy:                1.26.4
openpyxl:             <not installed>
pandas:               2.2.1
pyarrow:              15.0.2
pydantic:             <not installed>
pyiceberg:            <not installed>
sqlalchemy:           <not installed>
torch:                <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@cmdlineluser cmdlineluser added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Jul 2, 2024
@stinodego stinodego added regression Issue introduced by a new release P-high Priority: high and removed needs triage Awaiting prioritization by a maintainer labels Jul 2, 2024
@stinodego stinodego added this to the 1.0.1 milestone Jul 2, 2024
@stinodego
Copy link
Member

Thanks for the report!

@stinodego stinodego changed the title regression: Expr.slice no longer allows length = None? Expr.slice no longer allows length = None Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-high Priority: high python Related to Python Polars regression Issue introduced by a new release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants