Skip to content

Commit 015e926

Browse files
committed
Merge pull request #4184 from cpcloud/fix-network-tests
TST: raise when no data are found when trying to dld multiple symbols
2 parents b3e5338 + a511dcb commit 015e926

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/io/data.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,12 @@ def _dl_mult_symbols(symbols, start, end, chunksize, retry_count, pause,
312312
'NaN.'.format(sym), SymbolWarning)
313313
stocks[sym] = np.nan
314314

315-
return Panel(stocks).swapaxes('items', 'minor')
315+
try:
316+
return Panel(stocks).swapaxes('items', 'minor')
317+
except AttributeError:
318+
# cannot construct a panel with just 1D nans indicating no data
319+
raise RemoteDataError("No data fetched using "
320+
"{0!r}".format(method.__name__))
316321

317322

318323
_source_functions = {'google': _get_hist_google, 'yahoo': _get_hist_yahoo}

0 commit comments

Comments
 (0)