Jean-Frédéric has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378886 )

Change subject: Skip SPARQL type in missing_commonscat_links.py
......................................................................

Skip SPARQL type in missing_commonscat_links.py

This script was crashing when processing nl-wd with:
```
  File "missing_commonscat_links.py", line 115, in lookupSourceField
    for field in countryconfig.get('fields'):
TypeError: 'NoneType' object is not iterable
```
because SPARQL sources do not fields.

This script is not meant to be used for SPARQL sources,
we just skip them silently.

Bug: T175899
Change-Id: I5b968f8c9ad4beabf3d76ed339e4b018ff14bded
---
M erfgoedbot/missing_commonscat_links.py
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/86/378886/1

diff --git a/erfgoedbot/missing_commonscat_links.py 
b/erfgoedbot/missing_commonscat_links.py
index fd5898d..85974a1 100644
--- a/erfgoedbot/missing_commonscat_links.py
+++ b/erfgoedbot/missing_commonscat_links.py
@@ -33,6 +33,10 @@
         # missingCommonscatPage not set, just skip silently.
         return False
 
+    if countryconfig.get('type') == 'sparql':
+        # This script does not (yet) work for SPARQL sources, skip silently
+        return False
+
     commonscatField = lookupSourceField(u'commonscat', countryconfig)
     if not commonscatField:
         # Field is missing. Something is seriously wrong, but we just skip it

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b968f8c9ad4beabf3d76ed339e4b018ff14bded
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Jean-Frédéric <jeanfrederic.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to