From 48e114d940c46c933e49265e83c6b2ccb0064d81 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Thu, 15 Jun 2017 12:46:04 -0700 Subject: [PATCH] Specify user_id on load_user() calls Two load_user() calls didn't specify the argument user_id in record_processor module, that meaned the parameters were passed as seq, instead of user_id. In load_user(), seq and user_id are handled as the same way and we didn't face any problem due to this bug. This patch makes the method specify the argument clearly to avoid issues when changing internal behavior of load_user(). Change-Id: I1bfd08c273bd0272eada7cb3b27930a0f7a43315 --- stackalytics/processor/record_processor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stackalytics/processor/record_processor.py b/stackalytics/processor/record_processor.py index 0288efd63..53ac03793 100644 --- a/stackalytics/processor/record_processor.py +++ b/stackalytics/processor/record_processor.py @@ -587,7 +587,8 @@ class RecordProcessor(object): # _update_record_and_user function will create new user if needed self._update_record_and_user(record) record['company_name'] = company_name - user = user_processor.load_user(self.runtime_storage_inst, user_id) + user = user_processor.load_user(self.runtime_storage_inst, + user_id=user_id) user['user_name'] = record['author_name'] user['companies'] = [{ @@ -894,7 +895,7 @@ class RecordProcessor(object): yield record user = user_processor.load_user(self.runtime_storage_inst, - record['user_id']) + user_id=record['user_id']) LOG.debug('Update user %s, company name changed to %s', user, company_name) user['companies'] = [{