python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

AlchemyNewsDataV1 does not support pagination

Open jtreleaven opened this issue 10 years ago • 1 comments

Will currently throw the following error if you try to add the "next" query parameter to retrieve the next page.

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/watson_developer_cloud/alchemy_data_news_v1.py", line 39, in get_news_documents
    return self._alchemy_html_request(method_url='/data/GetNews', method='GET', params=params)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/watson_developer_cloud/watson_developer_cloud_service.py", line 177, in _alchemy_html_request
    accept_json=True)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/watson_developer_cloud/watson_developer_cloud_service.py", line 245, in request
    raise WatsonException('Error: ' + error_message)
WatsonException: Error: Invalid field = 'next'

I've identified the bug in the code and will place a PR soon. Adding this issue for documentation/tracking purposes.

jtreleaven avatar Apr 07 '16 03:04 jtreleaven

Fixed in 302c9b588610536ec99f6c6673799c3d68789cdb

jsstylos avatar Apr 12 '16 19:04 jsstylos