Page MenuHomePhabricator

Pywikibase cannot extract sources from revisions that have a lot of content?
Closed, InvalidPublic

Description

I got an error "KeyError: 'upperBound'" when I attempted to use revscoring to extract sources from revisions that have a lot of content. For example, rev_id: 492604879 (Berlin) or 489599663 (Australia).

Below is the chunk of my code:

from revscoring.extractors import api
import mwapi
from revscoring.features import wikibase
extractor = api.Extractor(mwapi.Session("https://www.wikidata.org", user_agent="wikibase testing revscoring"))
list_print = []
list_print = extractor.extract(489599663, [wikibase.revision.sources])

My pywikibase seems already updated to the latest version. I wonder if this was a bug or just a problem on my local.

Event Timeline

Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptJun 1 2017, 1:32 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Halfak added a subscriber: Halfak.Jun 1 2017, 2:06 PM
>>> from revscoring.extractors import api
>>> import mwapi
>>> from revscoring.features import wikibase
>>> extractor = api.Extractor(mwapi.Session("https://www.wikidata.org", user_agent="wikibase testing revscoring"))
>>> list_print = []
>>> list_print = extractor.extract(489599663, [wikibase.revision.sources])
>>> print(list_print)
<generator object _solve_many at 0x7f801dc81e08>
>>> print(list(list_print))
[389]
>>> import pywikibase
>>> pywikibase.__version__
'0.0.5'

Works for me.

Halfak closed this task as Invalid.Jun 1 2017, 2:06 PM

Ok got it. Thanks for the hint!

FYI, it's not updated yet on the Python package index (https://pypi.python.org/pypi/pywikibase/)

Change 357107 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[pywikibot/wikibase@master] Remove extra comma in about.py

https://gerrit.wikimedia.org/r/357107

Change 357107 merged by jenkins-bot:
[pywikibot/wikibase@master] Remove extra comma in about.py

https://gerrit.wikimedia.org/r/357107

I uploaded the new version to PyPI.