Page MenuHomePhabricator

Wrong paraminfo for query+proofreadpagesinindex
Closed, InvalidPublicBUG REPORT

Description

Steps to replicate the issue:

import pywikibot
import pywikibot.proofreadpage as pp
site = pywikibot.Site('en', 'wikisource')
page = pp.IndexPage(site, 'Index:Confederate Military History - 1899 - Volume 4.djvu')

Internally, IndexPage() calls self._get_prp_index_pagelist(self), which calls:

pi_gen = site._generator(ListGenerator, 'proofreadpagesinindex', **ppi_args)

What happens?:

WARNING: API warning (main): Unrecognized parameter: prppiilimit.

What should have happened instead?:
No warning.

https://en.wikisource.org/wiki/Special:ApiSandbox#action=paraminfo&format=json&modules=query%2Bproofreadpagesinindex
only lists 3 parameters

"parameters": [
    {
        "index": 1,
        "name": "prop",
        "type": [
            "ids",
            "title"
        ],
        "default": "ids|title",
        "multi": "",
        "lowlimit": 50,
        "highlimit": 500,
        "limit": 500
    },
    {
        "index": 2,
        "name": "title",
        "type": "string"
    },
    {
        "index": 3,
        "name": "pageid",
        "type": "integer"
    }
]

while:

In [15]: site._paraminfo['query+proofreadpagesinindex']['parameters']
Out[15]: 
[{'index': 1, 'name': 'continue', 'type': 'integer'},
 {'index': 2,
  'name': 'prop',
  'type': ['ids', 'title'],
  'default': 'ids|title',
  'multi': '',
  'lowlimit': 50,
  'highlimit': 500,
  'limit': 500},
 {'index': 3, 'name': 'title', 'type': 'string'},
 {'index': 4, 'name': 'pageid', 'type': 'integer'},
 {'index': 5,
  'name': 'limit',
  'type': 'limit',
  'default': 100,
  'min': 1,
  'max': 500,
  'highmax': 5000}]

I am not sure it the misalignment happens in pywikibot or it is due to how proofreadpagesinindex is implemented/exposes its paramenters.

Event Timeline

API query:

URI: '/w/api.php'
Body: 'prppiititle=Index%3AConfederate+Military+History+-+1899+-+Volume+4.djvu&list=proofreadpagesinindex&action=query&indexpageids=&continue=&prppiilimit=500&meta=userinfo&uiprop=blockinfo%7Chasmsg&maxlag=5&format=json'

@Mpaa prppiilimit was recently removed as a result of T314022, I'm guessing pywikibot hasn't been updated ?

Essentially the limit wasn't really usefull since it lead to multiple small requests and for every request, the pagelist/page (and all it's pages) had to be loaded on every request anyway.

I cleared pywikibot cache and now they are aligned.

In [3]: site._paraminfo['query+proofreadpagesinindex']['parameters']
Out[3]: 
[{'index': 1,
  'name': 'prop',
  'type': ['ids', 'title'],
  'default': 'ids|title',
  'multi': '',
  'lowlimit': 50,
  'highlimit': 500,
  'limit': 500},
 {'index': 2, 'name': 'title', 'type': 'string'},
 {'index': 3, 'name': 'pageid', 'type': 'integer'}]

Do not know what has changed compared to what I had in cache for paraminfo, but seems OK now.

@Mpaa prppiilimit was recently removed as a result of T314022, I'm guessing pywikibot hasn't been updated ?

Ah, OK, that explains :-) Thanks @Soda