Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Yelp/mrjob
Browse files Browse the repository at this point in the history
  • Loading branch information
David Marin committed Mar 9, 2015
2 parents b1d3a86 + d98c6e9 commit 7ec2cad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mrjob/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ def __init__(self, **kwargs):
raise ValueError("Step has no mappers and no reducers")

self.has_explicit_mapper = any(
name for name in kwargs if name in _MAPPER_FUNCS)
value for name, value in kwargs.iteritems() if name in _MAPPER_FUNCS)

self.has_explicit_combiner = any(
name for name in kwargs if name in _COMBINER_FUNCS)
value for name, value in kwargs.iteritems() if name in _COMBINER_FUNCS)

self.has_explicit_reducer = any(
name for name in kwargs if name in _REDUCER_FUNCS)
value for name, value in kwargs.iteritems() if name in _REDUCER_FUNCS)

steps = dict((f, None) for f in _JOB_STEP_PARAMS)

Expand Down
27 changes: 27 additions & 0 deletions tests/test_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ def test_explicit_combiner(self):
def test_explicit_reducer(self):
self._test_explicit(reducer=identity_reducer, r=True)

def test_no_explicit_mapper(self):
self._test_explicit(mapper=None, m=False)

def test_no_explicit_combiner(self):
self._test_explicit(combiner=None, c=False)

def test_no_explicit_reducer(self):
self._test_explicit(reducer=None, r=False)

# final

def test_explicit_mapper_final(self):
Expand All @@ -140,6 +149,15 @@ def test_explicit_combiner_final(self):
def test_explicit_reducer_final(self):
self._test_explicit(reducer_final=identity_reducer, r=True)

def test_no_explicit_mapper_final(self):
self._test_explicit(mapper_final=None, m=False)

def test_no_explicit_combiner_final(self):
self._test_explicit(combiner_final=None, c=False)

def test_no_explicit_reducer_final(self):
self._test_explicit(reducer_final=None, r=False)

# init

def test_explicit_mapper_init(self):
Expand All @@ -151,6 +169,15 @@ def test_explicit_combiner_init(self):
def test_explicit_reducer_init(self):
self._test_explicit(reducer_init=identity_reducer, r=True)

def test_no_explicit_mapper_init(self):
self._test_explicit(mapper_init=None, m=False)

def test_no_explicit_combiner_init(self):
self._test_explicit(combiner_init=None, c=False)

def test_no_explicit_reducer_init(self):
self._test_explicit(reducer_init=None, r=False)

# cmd

def test_explicit_mapper_cmd(self):
Expand Down

0 comments on commit 7ec2cad

Please sign in to comment.