-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
refactor(python): Return correct temporal type from Rust in to_numpy
#14353
Conversation
adfaadf
to
0d0506b
Compare
Couldn't we reuse the |
We cannot reuse those because they return floats. This could be a little bit less wasteful if we had a way to create a Datetime view of an existing integer array, similar to what we have in Python right now. But I don't think the difference will be significant. I think you were planning to add a view-type functionality to our Rust to_numpy though, right? So maybe we wait for that and see if we can do this more efficiently. |
Alright. @stinodego can you refactor this one with the new array views? We could probably remove the old view completely. |
The old view has now been removed in a different PR. It would still be nice to support creating views with different dtypes in Rust, e.g. a This PR is about the path with nulls, which requires copying the data. Technically we can create an i64 array and then create a view afterwards, but just creating the correct array type right away seems more sensible. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14353 +/- ##
==========================================
- Coverage 80.96% 80.95% -0.02%
==========================================
Files 1386 1386
Lines 178492 178428 -64
Branches 2882 2877 -5
==========================================
- Hits 144508 144438 -70
- Misses 33492 33498 +6
Partials 492 492 ☔ View full report in Codecov by Sentry. |
Ref #14334
... as opposed to returning an integer array and then creating a view afterwards.