Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when calling wdi_core.WDItemEngine.delete_items #116

Open
cfellicious opened this issue Mar 9, 2020 · 3 comments
Open

Error when calling wdi_core.WDItemEngine.delete_items #116

cfellicious opened this issue Mar 9, 2020 · 3 comments

Comments

@cfellicious
Copy link

When calling the "wdi_core.WDItemEngine.delete_items" function on our custom Wikibase(v1.32) the code crashes with the error message:
"for x in requests.get(url=url, params=params, headers=headers).json()['query']['pages'].values()][
KeyError: 'pages'"

I ran this piece of code requests.get(url=url, params=params, headers=headers).json() and got this as the result
{'batchcomplete': '', 'query': {'normalized': [{'from': 'Wikidata:Requests_for_deletions', 'to': 'wikidata:Requests for deletions'}], 'interwiki': [{'title': 'wikidata:Requests for deletions', 'iw': 'wikidata'}]}}

@LeMyst
Copy link
Contributor

LeMyst commented May 20, 2020

I confirm the issue.

@andrawaag
Copy link
Collaborator

This might require a redesign. This function is aimed at wikidata, where the functionality is a bit different than in wikibase. In the latter users can delete directly, whereas in Wikidata (at least from a user perspective) deletions are issued through requests for deletions.

I will investigate.

@LeMyst
Copy link
Contributor

LeMyst commented May 20, 2020

I created PR #131 to use the API action=delete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants