Skip to content

TST: YahooOptions get_all_data failure #7524

Closed
@jreback

Description

@jreback

cc @dstephens99

Almost certainly a bad data failure

for the first should guard this with a try: except: (and make that value nan)
2nd needs a guard on the test to skip with a RemoteError? (I think this is done with some of the other tests)?

======================================================================
ERROR: test_get_all_data (pandas.io.tests.test_data.TestYahooOptions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\util\testing.py", line 1308, in wrapper
    return t(*args, **kwargs)
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\tests\test_data.py", line 316, in test_get_all_data
    data = self.aapl.get_all_data(put=True)
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\data.py", line 1107, in get_all_data
    frame = getattr(self, meth_name)(expiry=month)
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\data.py", line 792, in get_call_data
    return self._get_option_data(month, year, expiry, 'calls').sortlevel()
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\data.py", line 719, in _get_option_data
    tables = self._get_option_tables(month, year, expiry)
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\data.py", line 686, in _get_option_tables
    self.underlying_price, self.quote_time = self._get_underlying_price(root)
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\data.py", line 691, in _get_underlying_price
    underlying_price = float(root.xpath('.//*[@class="time_rtq_ticker"]')[0]\
IndexError: list index out of range

======================================================================
ERROR: test_get_all_data_calls_only (pandas.io.tests.test_data.TestYahooOptions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\util\testing.py", line 1308, in wrapper
    return t(*args, **kwargs)
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\tests\test_data.py", line 325, in test_get_all_data_calls_only
    data = self.aapl.get_all_data(call=True, put=False)
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\data.py", line 1107, in get_all_data
    frame = getattr(self, meth_name)(expiry=month)
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\data.py", line 792, in get_call_data
    return self._get_option_data(month, year, expiry, 'calls').sortlevel()
  File "c:\Users\Jeff Reback\Documents\GitHub\pandas\build\lib.win-amd64-2.7\pandas\io\data.py", line 727, in _get_option_data
    " found".format(table_loc, ntables))
IndexError: Table location 9 invalid, 2 tables found

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO DataIO issues that don't fit into a more specific labelTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions