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

feat(rust, python): supports cast to list #10623

Merged
merged 4 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ xxhash-rust = { version = "0.8.6", features = ["xxh3"] }
[workspace.dependencies.arrow]
package = "arrow2"
git = "https://github.com/jorgecarleitao/arrow2"
rev = "2b3e2a9e83725a557d78b90cd39298c5bef0ca4a"
rev = "ba6a882bc1542b0b899774b696ebea77482b5c31"
# branch = ""
# version = "0.17.4"
default-features = false
Expand Down
10 changes: 10 additions & 0 deletions py-polars/tests/unit/datatypes/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pandas as pd

import polars as pl
from polars.testing import assert_series_equal


def test_dtype() -> None:
Expand Down Expand Up @@ -439,6 +440,15 @@ def test_list_recursive_categorical_cast() -> None:
assert s.to_list() == values


def test_non_nested_cast_to_list() -> None:
df = pl.DataFrame({"a": [1, 2, 3]})

df = df.with_columns([pl.col("a").cast(pl.List(pl.Int64))])

expected = pl.Series("a", [[1], [2], [3]])
assert_series_equal(df.to_series(), expected)


def test_list_new_from_index_logical() -> None:
s = (
pl.select(pl.struct(pl.Series("a", [date(2001, 1, 1)])).implode())
Expand Down