Bearloga has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377807 )

Change subject: Fix maplink/mapframe query
......................................................................

Fix maplink/mapframe query

Bug: T170022
Change-Id: I1d70b09a54b47002a948f29f21e1ad843b87af55
---
M modules/metrics/maps/config.yaml
M modules/metrics/maps/prevalence.R
M modules/metrics/maps/prevalence.yaml
3 files changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden 
refs/changes/07/377807/1

diff --git a/modules/metrics/maps/config.yaml b/modules/metrics/maps/config.yaml
index f74d21a..f5b3b46 100644
--- a/modules/metrics/maps/config.yaml
+++ b/modules/metrics/maps/config.yaml
@@ -40,12 +40,12 @@
     mapframe_prevalence:
         description: Proportion of articles on a wiki that have a mapframe
         granularity: days
-        starts: 2017-09-01 # this will need to be set to when patch goes live, 
we can't backfill this data
+        starts: 2017-09-14 # this will need to be set to when patch goes live, 
we can't backfill this data
         funnel: true
         type: script
     maplink_prevalence:
         description: Proportion of articles on a wiki that have a maplink
         granularity: days
-        starts: 2017-09-01 # this will need to be set to when patch goes live, 
we can't backfill this data
+        starts: 2017-09-14 # this will need to be set to when patch goes live, 
we can't backfill this data
         funnel: true
         type: script
diff --git a/modules/metrics/maps/prevalence.R 
b/modules/metrics/maps/prevalence.R
index 2d23ad9..c9fd596 100644
--- a/modules/metrics/maps/prevalence.R
+++ b/modules/metrics/maps/prevalence.R
@@ -35,14 +35,19 @@
   SUM(COALESCE({type}s, 0)) AS total_{type}s
 FROM (
   SELECT
-    page.page_id,
+    p.page_id,
     pp_value AS {type}s
   FROM (
     SELECT pp_page, pp_value
     FROM page_props
     WHERE pp_propname = '{prop_name}' AND pp_value > 0
   ) AS filtered_props
-  RIGHT JOIN page ON page.page_id = filtered_props.pp_page AND 
page.page_namespace = {ns}
+  RIGHT JOIN (
+    SELECT page_id
+    FROM page
+    WHERE page_namespace = {ns} AND page_is_redirect = 0
+  ) p
+  ON p.page_id = filtered_props.pp_page
 ) joined_tables;")
   return(query)
 }
diff --git a/modules/metrics/maps/prevalence.yaml 
b/modules/metrics/maps/prevalence.yaml
index c67d65a..f66d14e 100644
--- a/modules/metrics/maps/prevalence.yaml
+++ b/modules/metrics/maps/prevalence.yaml
@@ -16,6 +16,7 @@
     - mediawikiwiki
     - metawiki
     - commonswiki
+    - uawikimedia # as of August 2017
   wikivoyages: # enabled for all *except* the following:
     - hewikivoyage # https://phabricator.wikimedia.org/T170976#3471701
 maplink:

-- 
To view, visit https://gerrit.wikimedia.org/r/377807
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d70b09a54b47002a948f29f21e1ad843b87af55
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/golden
Gerrit-Branch: master
Gerrit-Owner: Bearloga <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to