Skip to content

Commit 2276f59

Browse files
authored
Merge pull request #589 from koshtinikhilesh/extra_check_for_source
Added extra check for verifying data source
2 parents 3200d6e + 04affd8 commit 2276f59

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas_datareader/data.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,19 @@ def DataReader(name, data_source=None, start=None, end=None,
303303
ff = DataReader("6_Portfolios_2x3", "famafrench")
304304
ff = DataReader("F-F_ST_Reversal_Factor", "famafrench")
305305
"""
306+
expected_source = ["yahoo", "google", "iex", "iex-tops", "iex-last",
307+
"iex-last", "bankofcanada", "stooq", "iex-book",
308+
"enigma", "fred", "famafrench", "oecd", "eurostat",
309+
"nasdaq", "quandl", "moex", "morningstar", 'robinhood',
310+
"tiingo", "yahoo-actions", "yahoo-dividends",
311+
"av-forex", "av-daily", "av-daily-adjusted",
312+
"av-weekly", "av-weekly-adjusted", "av-monthly",
313+
"av-monthly-adjusted"]
314+
315+
if data_source not in expected_source:
316+
msg = "data_source=%r is not implemented" % data_source
317+
raise NotImplementedError(msg)
318+
306319
if data_source == "yahoo":
307320
return YahooDailyReader(symbols=name, start=start, end=end,
308321
adjust_price=False, chunksize=25,

0 commit comments

Comments
 (0)