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

rolling.agg not returning the correct schema when fill_null is used #19011

Closed
2 tasks done
jackaixin opened this issue Sep 29, 2024 · 0 comments · Fixed by #19016
Closed
2 tasks done

rolling.agg not returning the correct schema when fill_null is used #19011

jackaixin opened this issue Sep 29, 2024 · 0 comments · Fixed by #19016
Assignees
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@jackaixin
Copy link

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

pl.LazyFrame({
    'a': [1, 2, 3, None, 5]
}).rolling(index_column=pl.int_range(pl.len()).alias('idx'), period='3i').agg(
    pl.col('a'),
    pl.col('a').fill_null(0).alias('a_1')
).collect_schema()

Log output

Schema([('idx', Int64), ('a', List(Int64)), ('a_1', Int64)])

Issue description

The schema of rolling.agg is wrong when fill_null is used.
In the example above, we applied fill_null to pl.col('a') and the schema switched from a list to a scalar.

Expected behavior

I expect the following schema output
Schema([('idx', Int64), ('a', List(Int64)), ('a_1', List(Int64))])

Installed versions

--------Version info---------
Polars:              1.8.2
Index type:          UInt32
Platform:            macOS-15.0-arm64-arm-64bit
Python:              3.11.9 (main, Apr  2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]

----Optional dependencies----
adbc_driver_manager  1.2.0
altair               5.4.1
cloudpickle          3.0.0
connectorx           0.3.3
deltalake            0.20.1
fastexcel            0.11.6
fsspec               2024.9.0
gevent               24.2.1
great_tables         0.12.0
matplotlib           3.8.2
nest_asyncio         1.6.0
numpy                1.26.2
openpyxl             3.1.5
pandas               2.1.4
pyarrow              17.0.0
pydantic             2.9.2
pyiceberg            0.7.1
sqlalchemy           2.0.35
torch                <not installed>
xlsx2csv             0.8.3
xlsxwriter           3.2.0
@jackaixin jackaixin added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Sep 29, 2024
@ritchie46 ritchie46 self-assigned this Sep 30, 2024
@c-peters c-peters added the accepted Ready for implementation label Oct 6, 2024
@c-peters c-peters moved this to Done in Backlog Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants