diff --git a/python/deltalake/schema.py b/python/deltalake/schema.py index bef9f46784..4b6a631ee6 100644 --- a/python/deltalake/schema.py +++ b/python/deltalake/schema.py @@ -74,7 +74,7 @@ def list_to_delta_dtype( def struct_to_delta_dtype(dtype: pa.StructType) -> pa.StructType: 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] + fields_cast = [f.with_type(dtype_to_delta_dtype(f.type)) for f in fields] return pa.struct(fields_cast) return pa.schema([f.with_type(dtype_to_delta_dtype(f.type)) for f in schema])