File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ def mapreduce(
4343 # Executable scripts must have valid shebangs
4444 is_executable (map_exe )
4545 is_executable (reduce_exe )
46+ # The partitioner executable expects to receive num_reducers as an arg
4647 if partitioner :
47- is_executable (partitioner )
48+ is_executable (partitioner , str ( num_reducers ) )
4849
4950 # Create a tmp directory which will be automatically cleaned up
5051 with tempfile .TemporaryDirectory (prefix = "madoop-" ) as tmpdir :
@@ -157,7 +158,7 @@ def normalize_input_paths(input_path):
157158 return input_paths
158159
159160
160- def is_executable (exe ):
161+ def is_executable (exe , * args ):
161162 """Verify exe is executable and raise exception if it is not.
162163
163164 Execute exe with an empty string input and verify that it returns zero. We
@@ -168,7 +169,7 @@ def is_executable(exe):
168169 exe = pathlib .Path (exe ).resolve ()
169170 try :
170171 subprocess .run (
171- str (exe ),
172+ [ str (exe ), * args ] ,
172173 shell = False ,
173174 input = "" .encode (),
174175 stdout = subprocess .PIPE ,
You can’t perform that action at this time.
0 commit comments