Skip to content

Commit

Permalink
add test for arrow conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Oct 4, 2024
1 parent 4daf571 commit db92878
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions py-polars/tests/unit/interop/test_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,3 +766,11 @@ def test_df_pycapsule_interface() -> None:
df2 = pl.from_arrow(out)
assert isinstance(df2, pl.DataFrame)
assert df.equals(df2)


def test_misaligned_nested_arrow_19097() -> None:
a = pl.Series("a", [1, 2, 3])
a = a.slice(1, 2) # by slicing we offset=1 the values
a = a.replace(2, None) # then we add a validity mask with offset=0
a = a.reshape((2, 1)) # then we make it nested
assert_series_equal(pl.Series(a.to_arrow()), a)

0 comments on commit db92878

Please sign in to comment.