30
30
from enum import Enum
31
31
from io import BytesIO
32
32
from urllib .parse import urlparse
33
+ from copy import copy
33
34
34
35
from typing import Union , List , Dict , Optional
35
36
@@ -279,11 +280,9 @@ def run(
279
280
def _extend_processing_args (self , inputs , outputs , ** kwargs ):
280
281
"""Extends processing job args such as inputs."""
281
282
282
- # make a copy of user outputs
283
+ # make a shallow copy of user outputs
283
284
outputs = outputs or []
284
- extended_outputs = []
285
- for user_output in outputs :
286
- extended_outputs .append (user_output )
285
+ extended_outputs = copy (outputs )
287
286
288
287
if kwargs .get ("spark_event_logs_s3_uri" ):
289
288
spark_event_logs_s3_uri = kwargs .get ("spark_event_logs_s3_uri" )
@@ -305,11 +304,9 @@ def _extend_processing_args(self, inputs, outputs, **kwargs):
305
304
306
305
extended_outputs .append (output )
307
306
308
- # make a copy of user inputs
307
+ # make a shallow copy of user inputs
309
308
inputs = inputs or []
310
- extended_inputs = []
311
- for user_input in inputs :
312
- extended_inputs .append (user_input )
309
+ extended_inputs = copy (inputs )
313
310
314
311
if kwargs .get ("configuration" ):
315
312
configuration = kwargs .get ("configuration" )
@@ -958,9 +955,7 @@ def _extend_processing_args(self, inputs, outputs, **kwargs):
958
955
inputs = []
959
956
960
957
# make a shallow copy of user inputs
961
- extended_inputs = []
962
- for user_input in inputs :
963
- extended_inputs .append (user_input )
958
+ extended_inputs = copy (inputs )
964
959
965
960
self .command = [_SparkProcessorBase ._default_command ]
966
961
extended_inputs = self ._handle_script_dependencies (
@@ -1225,9 +1220,7 @@ def _extend_processing_args(self, inputs, outputs, **kwargs):
1225
1220
inputs = []
1226
1221
1227
1222
# make a shallow copy of user inputs
1228
- extended_inputs = []
1229
- for user_input in inputs :
1230
- extended_inputs .append (user_input )
1223
+ extended_inputs = copy (inputs )
1231
1224
1232
1225
extended_inputs = self ._handle_script_dependencies (
1233
1226
extended_inputs , kwargs .get ("submit_jars" ), FileType .JAR
0 commit comments