mirror of
https://github.com/donnemartin/system-design-primer.git
synced 2025-12-15 17:38:56 +03:00
Variable name: change seller to category
In the current code, __seller__ is an unused variable and __category__ is an undefined name (see #93). Given that the class is __SpendingByCategory__, this PR advocates changing seller —> category.
This commit is contained in:
@@ -30,7 +30,7 @@ class SpendingByCategory(MRJob):
|
|||||||
(2016-01, shopping), 100
|
(2016-01, shopping), 100
|
||||||
(2016-01, gas), 50
|
(2016-01, gas), 50
|
||||||
"""
|
"""
|
||||||
timestamp, seller, amount = line.split('\t')
|
timestamp, category, amount = line.split('\t')
|
||||||
period = self. extract_year_month(timestamp)
|
period = self. extract_year_month(timestamp)
|
||||||
if period == self.current_year_month():
|
if period == self.current_year_month():
|
||||||
yield (period, category), amount
|
yield (period, category), amount
|
||||||
|
|||||||
Reference in New Issue
Block a user