Skip to content

Conversation

kdn36
Copy link
Collaborator

@kdn36 kdn36 commented Jun 9, 2025

fixes #23102

Pending review, see issue for solution strategies.

Works for Datetime and Duration, but not for Decimal as cast behaves differently. Should we use from_physical_unchecked instead?

*edit: latest commit uses from_physical_unchecked and works for Decimal as well.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Jun 9, 2025
@kdn36 kdn36 marked this pull request as draft June 9, 2025 19:34
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.85%. Comparing base (21a8393) to head (f6fbabc).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #23137   +/-   ##
=======================================
  Coverage   80.84%   80.85%           
=======================================
  Files        1615     1615           
  Lines      217405   217418   +13     
  Branches     2809     2809           
=======================================
+ Hits       175767   175793   +26     
+ Misses      40974    40961   -13     
  Partials      664      664           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kdn36 kdn36 marked this pull request as ready for review June 10, 2025 07:00
.iter()
.flat_map(|s| {
let lst = s.list().unwrap();
lst.get_as_series(0)
})
.collect::<Vec<_>>();

// we may need to recast back from physical dtype
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: move this into the above loop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok - as a conditional extra map or unconditional inside the flat_map? (unconditional sounds right and consistent, however it is unsafe)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok - as a conditional extra map or unconditional inside the flat_map? (unconditional sounds right and consistent, however it is unsafe)

I think this is up to your personal preference.

One other thing, can you as a drive-by change that to use filter_map instead of flat_map.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack & done - ended up keeping the to/from_physical calls close together

@nameexhaustion nameexhaustion merged commit 1610ad2 into pola-rs:main Jun 10, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broadcast issue when trying to add a literal Datetime to a list with list.concat
2 participants