Skip to content

Commit

Permalink
use struct direct indexing for backwards pyarrow compat
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Nov 11, 2023
1 parent ce0d5c5 commit 3a1a120
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/deltalake/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 3a1a120

Please sign in to comment.