pola-rs / r-polars

Bring polars to R
https://pola-rs.github.io/r-polars/
Other
405 stars 35 forks source link

refactor: swap `pl$Series` and `as_polars_series.default` #1015

Closed eitsupi closed 1 month ago

eitsupi commented 1 month ago

Related to #1012.

as_polars_series.default() used to call pl$Series(), but will be changed so that pl$Series() calls as_polars_series(). This will ensure that every object is properly converted to a Series with pl$Series().

Python's polars.Series.__init__() internally converts various objects into a Series through a large number of conditional branches. This update is very similar to that.