From 5d34eaa48e371635df09fe671c92092ffe6e5af6 Mon Sep 17 00:00:00 2001 From: "Ian Y. Choi" Date: Thu, 26 May 2016 08:38:11 +0900 Subject: [PATCH] [translation] include branch into primary key Translation statistics records can be identified using user_id, project name (module), translated date (date), and branch name (branch). There can be several records for the same project and date, but different branches. Those records cannot be distinguished without branch on the translation primary key. Change-Id: I93059b62247ea3a7924f15dd610106d2bb5aaacb --- stackalytics/processor/record_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stackalytics/processor/record_processor.py b/stackalytics/processor/record_processor.py index dfaea35e6..d82372e72 100644 --- a/stackalytics/processor/record_processor.py +++ b/stackalytics/processor/record_processor.py @@ -616,8 +616,8 @@ class RecordProcessor(object): user_id = user_processor.make_user_id(zanata_id=record['zanata_id']) translation['record_type'] = 'tr' - translation['primary_key'] = '%s:%s:%s' % ( - user_id, record['module'], record['date']) + translation['primary_key'] = '%s:%s:%s:%s' % ( + user_id, record['module'], record['date'], record['branch']) translation['author_name'] = user_id # following fields are put into standard fields stored in dashboard mem