@@ -514,26 +514,28 @@ def get_table_or_partition(table, dataset: nil)
514
514
515
515
# update only column.description
516
516
def patch_table
517
- table = get_table ( @task [ 'table' ] )
518
-
519
- def patch_description ( fields , column_options )
520
- fields . map do |field |
521
- column_option = column_options . select { |col_opt | col_opt [ 'name' ] == field . name } . first
522
- if column_option
523
- field . update! ( description : column_option [ 'description' ] ) if column_option [ 'description' ]
524
- if field . fields && column_option [ 'fields' ]
525
- nested_fields = patch_description ( field . fields , column_option [ 'fields' ] )
526
- field . update! ( fields : nested_fields )
517
+ with_job_retry do
518
+ table = get_table ( @task [ 'table' ] )
519
+
520
+ def patch_description ( fields , column_options )
521
+ fields . map do |field |
522
+ column_option = column_options . select { |col_opt | col_opt [ 'name' ] == field . name } . first
523
+ if column_option
524
+ field . update! ( description : column_option [ 'description' ] ) if column_option [ 'description' ]
525
+ if field . fields && column_option [ 'fields' ]
526
+ nested_fields = patch_description ( field . fields , column_option [ 'fields' ] )
527
+ field . update! ( fields : nested_fields )
528
+ end
527
529
end
530
+ field
528
531
end
529
- field
530
532
end
531
- end
532
533
533
- fields = patch_description ( table . schema . fields , @task [ 'column_options' ] )
534
- table . schema . update! ( fields : fields )
535
- table_id = Helper . chomp_partition_decorator ( @task [ 'table' ] )
536
- client . patch_table ( @project , @dataset , table_id , table )
534
+ fields = patch_description ( table . schema . fields , @task [ 'column_options' ] )
535
+ table . schema . update! ( fields : fields )
536
+ table_id = Helper . chomp_partition_decorator ( @task [ 'table' ] )
537
+ with_network_retry { client . patch_table ( @project , @dataset , table_id , table ) }
538
+ end
537
539
end
538
540
end
539
541
end
0 commit comments