Skip to content

Commit

Permalink
chore: Fix incorrect debug assertion in `ChunkedArray::from_chunks_an…
Browse files Browse the repository at this point in the history
…d_dtype`
  • Loading branch information
stinodego committed Jun 4, 2024
1 parent ea086d6 commit ac3ca3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion crates/polars-core/src/chunked_array/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ where
#[cfg(debug_assertions)]
{
if !chunks.is_empty() && dtype.is_primitive() {
assert_eq!(chunks[0].data_type(), &dtype.to_physical().to_arrow(true))
assert_eq!(
chunks[0].data_type().underlying_physical_type(),
dtype.to_arrow(true)
)
}
}
let field = Arc::new(Field::new(name, dtype));
Expand Down
3 changes: 2 additions & 1 deletion py-polars/tests/unit/series/test_to_list.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from hypothesis import given
from hypothesis import example, given

import polars as pl
from polars.testing import assert_series_equal
Expand All @@ -14,6 +14,7 @@
allow_time_zones=False,
)
)
@example(s=pl.Series(dtype=pl.Array(pl.Date, 1)))
def test_to_list(s: pl.Series) -> None:
values = s.to_list()
result = pl.Series(values, dtype=s.dtype)
Expand Down

0 comments on commit ac3ca3f

Please sign in to comment.