Skip to content

Commit

Permalink
combine list+struct
Browse files Browse the repository at this point in the history
  • Loading branch information
DeaMariaLeon committed Oct 17, 2024
1 parent 279b047 commit 9f90db7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions narwhals/_pandas_like/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def native_to_narwhals_dtype(native_column: Any, dtypes: DTypes) -> DType:
return dtypes.Duration(du_time_unit)
if dtype == "date32[day][pyarrow]":
return dtypes.Date()
if dtype.startswith(("large_list", "list")):
if dtype.startswith(("large_list", "list", "struct")):
return arrow_native_to_narwhals_dtype(native_column.dtype.pyarrow_dtype, dtypes)
if dtype.startswith("fixed_size_list"):
return dtypes.Array(
Expand All @@ -289,8 +289,6 @@ def native_to_narwhals_dtype(native_column: Any, dtypes: DTypes) -> DType:
),
native_column.dtype.pyarrow_dtype.list_size,
)
if dtype.startswith("struct"):
return arrow_native_to_narwhals_dtype(native_column.dtype.pyarrow_dtype, dtypes)
if dtype == "object":
if ( # pragma: no cover TODO(unassigned): why does this show as uncovered?
idx := getattr(native_column, "first_valid_index", lambda: None)()
Expand Down

0 comments on commit 9f90db7

Please sign in to comment.