From 3a1a120b823e6ab9abb5e76c26d6d75ae020b25a Mon Sep 17 00:00:00 2001 From: ion-elgreco <15728914+ion-elgreco@users.noreply.github.com> Date: Sat, 11 Nov 2023 10:29:37 +0100 Subject: [PATCH] use struct direct indexing for backwards pyarrow compat --- python/deltalake/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/deltalake/schema.py b/python/deltalake/schema.py index ddaf256a49..1667ef6e76 100644 --- a/python/deltalake/schema.py +++ b/python/deltalake/schema.py @@ -70,7 +70,7 @@ def list_to_delta_dtype( return pa.list_(nested_dtype_cast) def struct_to_delta_dtype(dtype: pa.StructType) -> pa.StructType: - fields = [dtype.field(i) for i in range(dtype.num_fields)] + fields = [dtype[i] for i in range(dtype.num_fields)] fields_cast = [pa.field(f.name, dtype_to_delta_dtype(f.type)) for f in fields] return pa.struct(fields_cast)