[misc] 01/01: Sort an de-duplicate in Python; SQL DISTINCT is too weird to understand.

Chris Lamb chris at chris-lamb.co.uk
Mon Nov 7 10:48:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository misc.

commit 594d7248792c5db28d9cf20cddde8722a460aaf0
Author: Chris Lamb <lamby at debian.org>
Date:   Mon Nov 7 10:47:58 2016 +0000

    Sort an de-duplicate in Python; SQL DISTINCT is too weird to understand.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 reports/bin/generate-draft | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/reports/bin/generate-draft b/reports/bin/generate-draft
index 253a16d..85dedfb 100755
--- a/reports/bin/generate-draft
+++ b/reports/bin/generate-draft
@@ -149,9 +149,9 @@ def bugs(week_start, week_end, extra="true"):
 
     result = {}
     for x in udd(sql, fields):
-        result.setdefault(x['submitter_name'], []).append(x)
+        result.setdefault(x['submitter_name'], set()).add(x)
 
-    return result
+    return {x: list(sorted(y)) for x, y in result.items()}
 
 def get_uploads(week_start, week_end):
     log("Querying UDD for uploads")

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list