Update get_news() to work when no sources are provided.

Currently, `sources=[]` by default, which will become "" once the
list is `joined` to form a csv string. The tiingo api appears to
interpret the empty string as "don't match any sources" instead of
"match all sources". This commit fixes the problem by setting
`sources` to `None` if the list is empty.

Adds unit test for empty new sources list.

Updates HISTORY.rst with note about bug fix.
This commit is contained in:
David Minnen
2021-01-06 22:28:30 -08:00
committed by DavidMinnen
parent f6ef473b0d
commit aed36edb65
5 changed files with 60 additions and 2 deletions

View File

@@ -338,7 +338,7 @@ class TiingoClient(RestClient):
'offset': offset,
'sortBy': sortBy,
'tickers': tickers,
'source': (",").join(sources),
'source': (",").join(sources) if sources else None,
'tags': tags,
'startDate': startDate,
'endDate': endDate,