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

datetime_range PanicException with nanosecond interval #19931

Open
2 tasks done
cmdlineluser opened this issue Nov 22, 2024 · 0 comments · May be fixed by #19955
Open
2 tasks done

datetime_range PanicException with nanosecond interval #19931

cmdlineluser opened this issue Nov 22, 2024 · 0 comments · May be fixed by #19955
Assignees
Labels
A-panic Area: code that results in panic exceptions A-temporal Area: date/time functionality bug Something isn't working python Related to Python Polars

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

pl.datetime_range(pl.date(2022, 1, 1), pl.date(2022, 1, 1), interval="1ns", time_unit="ms", eager=True)
# PanicException: assertion failed: step != 0

Log output

thread '<unnamed>' panicked at /rustc/a0d98ff0e5b6e1f2c63fd26f68484792621b235c/library/core/src/iter/adapters/step_by.rs:35:9:
assertion failed: step != 0

Issue description

Not too sure if this code actually makes sense or not - it was just some random experimentation.

I'm guessing it doesn't - and an appropriate error should be raised instead.

Expected behavior

No panic.

Installed versions

--------Version info---------
Polars:               1.14.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 Nov 22, 2024
@MarcoGorelli MarcoGorelli added A-temporal Area: date/time functionality A-panic Area: code that results in panic exceptions and removed needs triage Awaiting prioritization by a maintainer labels Nov 22, 2024
@MarcoGorelli MarcoGorelli self-assigned this Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-panic Area: code that results in panic exceptions A-temporal Area: date/time functionality bug Something isn't working python Related to Python Polars
Projects
None yet
2 participants