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

fix: Properly handle from_physical for List/Array #20311

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

coastalwhite
Copy link
Collaborator

This fixes the following snippet panicking.

dtype = pl.List(pl.Datetime)
df = pl.Series('a', [[date(1996, 10, 5)]], dtype).to_frame()

print(df)
re = df._row_encode([(False, False, False)])
rt = re._row_decode([('a', dtype)], [(False, False, False)])
print(rt)

This fixes the following snippet panicking.

```python
dtype = pl.List(pl.Datetime)
df = pl.Series('a', [[date(1996, 10, 5)]], dtype).to_frame()

print(df)
re = df._row_encode([(False, False, False)])
rt = re._row_decode([('a', dtype)], [(False, False, False)])
print(rt)
```
@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Dec 16, 2024
@coastalwhite
Copy link
Collaborator Author

@ritchie46 I think this is quite a high priority fix actually

@ritchie46
Copy link
Member

Can you add some tests for this?

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 66.92913% with 42 lines in your changes missing coverage. Please review.

Project coverage is 79.61%. Comparing base (ff95fad) to head (3cff142).
Report is 46 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-core/src/chunked_array/array/mod.rs 0.00% 36 Missing ⚠️
crates/polars-core/src/series/mod.rs 84.37% 5 Missing ⚠️
...rates/polars-core/src/chunked_array/struct_/mod.rs 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20311      +/-   ##
==========================================
- Coverage   79.61%   79.61%   -0.01%     
==========================================
  Files        1567     1567              
  Lines      218453   218531      +78     
  Branches     2462     2462              
==========================================
+ Hits       173921   173980      +59     
- Misses      43965    43984      +19     
  Partials      567      567              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit 9521d97 into pola-rs:main Dec 16, 2024
18 checks passed
@c-peters c-peters added the accepted Ready for implementation label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants