Skip to content

Commit 83a6e36

Browse files
Merge pull request #74 from femtotrader/options_datasource_none
BUG: Options dispatch shouldn't return None when data_source is None
2 parents d7dea43 + 6b8d236 commit 83a6e36

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pandas_datareader/data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def Options(symbol, data_source=None):
8888
warnings.warn("Options(symbol) is deprecated, use Options(symbol,"
8989
" data_source) instead", FutureWarning)
9090
data_source = "yahoo"
91-
elif data_source == "yahoo":
91+
if data_source == "yahoo":
9292
return YahooOptions(symbol)
9393
else:
9494
raise NotImplementedError("currently only yahoo supported")

pandas_datareader/tests/test_data.py

+4
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ def test_get_near_stock_price(self):
329329
raise nose.SkipTest(e)
330330
self.assertTrue(len(options) > 1)
331331

332+
def test_options_is_not_none(self):
333+
option = web.Options('aapl')
334+
self.assertTrue(option is not None)
335+
332336
def test_get_call_data(self):
333337
try:
334338
calls = self.aapl.get_call_data(expiry=self.expiry)

0 commit comments

Comments
 (0)