Undefined name 'value'... Change to 'values' * 3

The function parameter in __reducer(self, key, value):__ is __value__ (without an _s_) but the function body uses __values__ with an _s_ which creates an undefined name.  Solution: change the function parameter from __value__ to __values__.
pull/149/head
cclauss 2018-03-14 13:06:54 +01:00 committed by GitHub
parent 38a93dc190
commit 8e8f78b2ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class SpendingByCategory(MRJob):
if period == self.current_year_month():
yield (period, category), amount
def reducer(self, key, value):
def reducer(self, key, values):
"""Sum values for each key.
(2016-01, shopping), 125