Skip to content

Commit

Permalink
fix type check error
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Ulmasov <[email protected]>
  • Loading branch information
r3stl355 committed Nov 18, 2023
1 parent 2d67292 commit bf73969
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/deltalake/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,20 @@ def _large_to_normal_dtype(dtype: pa.DataType) -> pa.DataType:
return dtype

if partition_by:
table_schema: pa.Schema = schema
if PYARROW_MAJOR_VERSION < 12:
partition_schema = pa.schema(
[
pa.field(name, _large_to_normal_dtype(schema.field(name).type))
pa.field(
name, _large_to_normal_dtype(table_schema.field(name).type)
)
for name in partition_by
]
)
else:
partition_schema = pa.schema([schema.field(name) for name in partition_by])
partition_schema = pa.schema(
[table_schema.field(name) for name in partition_by]
)
partitioning = ds.partitioning(partition_schema, flavor="hive")
else:
partitioning = None
Expand Down

0 comments on commit bf73969

Please sign in to comment.