polars icon indicating copy to clipboard operation
polars copied to clipboard

feat(rust, python)!: adjusting date method return values

Open andrewpollack opened this issue 2 years ago • 3 comments
trafficstars

Fixes: #6079

Tracking progress to adjust date method return values to more efficient int sizings

andrewpollack avatar Jan 16 '23 18:01 andrewpollack

EDIT: I see now these are gated behind flags #[cfg(feature = "dtype-i16")] and #[cfg(feature = "dtype-i8")]. Continuing onwards!

Chasing down errors from trait impl from differences between ChunkedArray<Int8Type> and ChunkedArray<Int32Type>

error[E0599]: the method `into_series` exists for struct `ChunkedArray<Int8Type>`, but its trait bounds were not satisfied
   --> polars/polars-lazy/polars-plan/src/dsl/function_expr/datetime.rs:101:28
    |
101 |     s.second().map(|ca| ca.into_series())
    |                            ^^^^^^^^^^^ method cannot be called on `ChunkedArray<Int8Type>` due to unsatisfied trait bounds
    |
   ::: /home/andrew/devel/polars/polars/polars/polars-core/src/chunked_array/mod.rs:150:1
    |
150 | pub struct ChunkedArray<T: PolarsDataType> {
    | ------------------------------------------ doesn't satisfy `_: IntoSeries`
    |
   ::: /home/andrew/devel/polars/polars/polars/polars-core/src/series/implementations/mod.rs:48:1
    |
48  | pub(crate) struct SeriesWrap<T>(pub T);
    | ------------------------------- doesn't satisfy `_: SeriesTrait`
    |
    = note: the following trait bounds were not satisfied:
            `implementations::SeriesWrap<polars_core::chunked_array::ChunkedArray<Int8Type>>: polars_core::prelude::SeriesTrait`
            which is required by `polars_core::chunked_array::ChunkedArray<Int8Type>: polars_core::prelude::IntoSeries`

For more information about this error, try `rustc --explain E0599`.

andrewpollack avatar Jan 16 '23 19:01 andrewpollack

Great that you're getting this done! I added a breaking tag, since this will break existing code.

stinodego avatar Jan 16 '23 19:01 stinodego

Got it! I've opened an issue to see if we could build that upstream https://github.com/jorgecarleitao/arrow2/issues/1372

As well, life circumstances have changed a bit and I do not have as much time to work on this as before. I apologize @ritchie46 and will try to get to this when I'm able to. Also happy to let others work on it should there be interest

andrewpollack avatar Jan 24 '23 15:01 andrewpollack

I am closing this PR as it has not been updated in a while.

Also, I believe the linked issue in the Arrow2 repo must be addressed first.

stinodego avatar Aug 09 '23 20:08 stinodego