Skip to content

Commit 3561dbd

Browse files
committed
Improved error handling and refactoring test to best practices, per jreback review.
1 parent 9c1d506 commit 3561dbd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pandas_datareader/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ def _read_url_as_StringIO(self, url, params=None):
8787
text = self._sanitize_response(response)
8888
out = StringIO()
8989
if len(text) == 0:
90-
raise IOError("Request returned no data.")
90+
service = self.__class__.__name__
91+
raise IOError("{} request returned no data; check URL for invalid "
92+
"inputs: {}".format(service, self.url))
9193
if isinstance(text, compat.binary_type):
9294
out.write(bytes_to_str(text))
9395
else:

pandas_datareader/tests/yahoo/test_yahoo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_get_data_multiple_symbols(self):
127127
def test_get_data_multiple_symbols_two_dates(self):
128128
pan = web.get_data_yahoo(['GE', 'MSFT', 'INTC'], 'JAN-01-12',
129129
'JAN-31-12')
130-
result = pan.Close['01-18-12'].transpose()
130+
result = pan.Close['01-18-12'].T
131131
assert result.size == 3
132132

133133
# sanity checking

0 commit comments

Comments
 (0)