@@ -2449,27 +2449,31 @@ def _dataframe_to_data_files(
24492449 yield from write_file (
24502450 io = io ,
24512451 table_metadata = table_metadata ,
2452- tasks = iter ([
2453- WriteTask (write_uuid = write_uuid , task_id = next (counter ), record_batches = batches , schema = task_schema )
2454- for batches in bin_pack_arrow_table (df , target_file_size )
2455- ]),
2452+ tasks = iter (
2453+ [
2454+ WriteTask (write_uuid = write_uuid , task_id = next (counter ), record_batches = batches , schema = task_schema )
2455+ for batches in bin_pack_arrow_table (df , target_file_size )
2456+ ]
2457+ ),
24562458 )
24572459 else :
24582460 partitions = _determine_partitions (spec = table_metadata .spec (), schema = table_metadata .schema (), arrow_table = df )
24592461 yield from write_file (
24602462 io = io ,
24612463 table_metadata = table_metadata ,
2462- tasks = iter ([
2463- WriteTask (
2464- write_uuid = write_uuid ,
2465- task_id = next (counter ),
2466- record_batches = batches ,
2467- partition_key = partition .partition_key ,
2468- schema = task_schema ,
2469- )
2470- for partition in partitions
2471- for batches in bin_pack_arrow_table (partition .arrow_table_partition , target_file_size )
2472- ]),
2464+ tasks = iter (
2465+ [
2466+ WriteTask (
2467+ write_uuid = write_uuid ,
2468+ task_id = next (counter ),
2469+ record_batches = batches ,
2470+ partition_key = partition .partition_key ,
2471+ schema = task_schema ,
2472+ )
2473+ for partition in partitions
2474+ for batches in bin_pack_arrow_table (partition .arrow_table_partition , target_file_size )
2475+ ]
2476+ ),
24732477 )
24742478
24752479
@@ -2534,10 +2538,12 @@ def _determine_partitions(spec: PartitionSpec, schema: Schema, arrow_table: pa.T
25342538 partition_columns : List [Tuple [PartitionField , NestedField ]] = [
25352539 (partition_field , schema .find_field (partition_field .source_id )) for partition_field in spec .fields
25362540 ]
2537- partition_values_table = pa .table ({
2538- str (partition .field_id ): partition .transform .pyarrow_transform (field .field_type )(arrow_table [field .name ])
2539- for partition , field in partition_columns
2540- })
2541+ partition_values_table = pa .table (
2542+ {
2543+ str (partition .field_id ): partition .transform .pyarrow_transform (field .field_type )(arrow_table [field .name ])
2544+ for partition , field in partition_columns
2545+ }
2546+ )
25412547
25422548 # Sort by partitions
25432549 sort_indices = pa .compute .sort_indices (
0 commit comments