Skip to content

Commit

Permalink
feat(rust, python): support cast to list (#10623)
Browse files Browse the repository at this point in the history
  • Loading branch information
reswqa authored Aug 21, 2023
1 parent 60efadf commit 4b388e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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

0 comments on commit 4b388e3

Please sign in to comment.