From 43d94ac138efd734253ef5e078f6136a9b5f7d10 Mon Sep 17 00:00:00 2001 From: lokas Date: Thu, 30 May 2024 21:47:32 +0300 Subject: [PATCH 1/2] add Normalize-MediaWiki-link-tables.md --- Normalize-MediaWiki-link-tables.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Normalize-MediaWiki-link-tables.md diff --git a/Normalize-MediaWiki-link-tables.md b/Normalize-MediaWiki-link-tables.md new file mode 100644 index 00000000..e69de29b From 6956169397be2c7d895d65c4619c8251a115b72d Mon Sep 17 00:00:00 2001 From: lokas Date: Thu, 30 May 2024 22:53:11 +0300 Subject: [PATCH 2/2] fix query --- tasks/users_this_week/README.md | 9 +++++---- tasks/users_this_week/data.py | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tasks/users_this_week/README.md b/tasks/users_this_week/README.md index 707da33c..7b91591e 100644 --- a/tasks/users_this_week/README.md +++ b/tasks/users_this_week/README.md @@ -19,10 +19,11 @@ FROM user_groups INNER JOIN user ON user_id = ug_user WHERE ug_group = "bot") - and actor_name not in (SELECT replace(pl_title,"_"," ") -FROM pagelinks -where pagelinks.pl_from = 7352181 -and pl_namespace = 2) + and actor_name not in (SELECT replace(lt_title, "_", " ") + FROM pagelinks + inner join linktarget ON lt_id = pl_target_id + WHERE pagelinks.pl_from = 7352181 + AND lt_namespace = 2) GROUP BY actor_name having COUNT(*) > 1 ORDER BY score DESC,name diff --git a/tasks/users_this_week/data.py b/tasks/users_this_week/data.py index acd2e36d..68653910 100644 --- a/tasks/users_this_week/data.py +++ b/tasks/users_this_week/data.py @@ -32,10 +32,11 @@ FROM user_groups INNER JOIN user ON user_id = ug_user WHERE ug_group = "bot") - and actor_name not in (SELECT replace(pl_title,"_"," ") -FROM pagelinks -where pagelinks.pl_from = 7352181 -and pl_namespace = 2) + and actor_name not in (SELECT replace(lt_title, "_", " ") + FROM pagelinks + inner join linktarget ON lt_id = pl_target_id + WHERE pagelinks.pl_from = 7352181 + AND lt_namespace = 2) GROUP BY actor_name having COUNT(*) > 1 ORDER BY score DESC,name