From cd7969ea1b66250a56d6cf776366ec3d2e97f8c3 Mon Sep 17 00:00:00 2001 From: Jakub Filipek Date: Sun, 31 Dec 2023 19:10:52 -0800 Subject: [PATCH] do the same for lists --- python/deltalake/schema.py | 2 +- python/tests/test_schema.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/python/deltalake/schema.py b/python/deltalake/schema.py index c42551ef1f..8b4ceb7651 100644 --- a/python/deltalake/schema.py +++ b/python/deltalake/schema.py @@ -46,7 +46,7 @@ def _convert_pa_schema_to_delta( def dtype_to_delta_dtype(dtype: pa.DataType) -> pa.DataType: # Handle nested types - if isinstance(dtype, (pa.LargeListType, pa.ListType)): + if isinstance(dtype, (pa.LargeListType, pa.ListType, pa.FixedSizeListType)): return list_to_delta_dtype(dtype) elif isinstance(dtype, pa.StructType): return struct_to_delta_dtype(dtype) diff --git a/python/tests/test_schema.py b/python/tests/test_schema.py index 419ee892c3..1df78eb7a3 100644 --- a/python/tests/test_schema.py +++ b/python/tests/test_schema.py @@ -295,6 +295,7 @@ def test_delta_schema(): pa.schema( [ ("some_list", pa.list_(pa.string())), + ("some_fixed_list_int", pa.list_(pa.uint32(), 5)), ("some_list_binary", pa.list_(pa.binary())), ("some_string", pa.large_string()), ] @@ -302,6 +303,7 @@ def test_delta_schema(): pa.schema( [ ("some_list", pa.large_list(pa.large_string())), + ("some_fixed_list_int", pa.list_(pa.int32())), ("some_list_binary", pa.large_list(pa.large_binary())), ("some_string", pa.large_string()), ]