Yelp / mrjob

Run MapReduce jobs on Hadoop or Amazon Web Services
http://packages.python.org/mrjob/
Other
2.62k stars 586 forks source link

MRJob.run() works on class but not instance #2123

Closed coyotemarin closed 4 years ago

coyotemarin commented 4 years ago

mrjob/examples/mr_grep.py ran MRGrepJob().run() when invoked as a script, and this caused it to mysteriously lose the command line arguments. Changing it to MRGrepJob.run() fixed it.

Not sure if this is an existing bug, or one I introduced when merging MRJobLauncher into MRJob (see #2088).

coyotemarin commented 4 years ago

Never mind, the problem here is that MRGrepJob had a required argument, so you couldn't run MRGrepJob().

There is not much practical reason to initialize a MRJob with no arguments (usually you at least want input), so we could change the default behavior so that no args means to read from sys.argv, rather than []. This might perturb some tests.