Skip to content

Commit cfe45b6

Browse files
Added extra check for verifying data source
1 parent 3200d6e commit cfe45b6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas_datareader/data.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,16 @@ 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", "iex-last", "bankofcanada",
307+
"stooq", "iex-book", "enigma", "fred", "famafrench", "oecd", "eurostat", "nasdaq",
308+
"quandl", "moex", "morningstar", 'robinhood', 'tiingo', "yahoo-actions",
309+
"yahoo-dividends", "av-forex", "av-daily", "av-daily-adjusted", "av-weekly",
310+
"av-weekly-adjusted", "av-monthly", "av-monthly-adjusted"]
311+
312+
if data_source not in expected_source:
313+
msg = "data_source=%r is not implemented" % data_source
314+
raise NotImplementedError(msg)
315+
306316
if data_source == "yahoo":
307317
return YahooDailyReader(symbols=name, start=start, end=end,
308318
adjust_price=False, chunksize=25,

0 commit comments

Comments
 (0)