jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1336058?usp=email )
Change subject: wikistats: Normalize family aliases before cache lookup
......................................................................
wikistats: Normalize family aliases before cache lookup
Responses are cached under canonical table names, but lookups used the
original family name. Repeated requests for aliases such as wikipedia
therefore fetched the same table again.
Normalize the name before checking the cache.
Change-Id: Ia1ce984b57634419dd311deee1bb90e6194085f2
---
M pywikibot/data/wikistats.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/wikistats.py b/pywikibot/data/wikistats.py
index 78704c4..c48f0a5 100644
--- a/pywikibot/data/wikistats.py
+++ b/pywikibot/data/wikistats.py
@@ -92,13 +92,13 @@
:param table: table of data to fetch
"""
+ table = self.FAMILY_MAPPING.get(table, table)
if table in _data:
return _data[table]
if table not in self.ALL_KEYS:
pywikibot.warning('WikiStats unknown table ' + table)
- table = self.FAMILY_MAPPING.get(table, table)
path = '/api.php?action=dump&table={table}&format=csv'
url = self.url + path
r = http.fetch(url.format(table=table))
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1336058?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia1ce984b57634419dd311deee1bb90e6194085f2
Gerrit-Change-Number: 1336058
Gerrit-PatchSet: 3
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]