'get_pricing' API is used to be working but today I can't load the price data with exactly the same code.
price_df = get_pricing(stock_universe, start_date = time_range[0], end_date = time_range[-1]), handle_missing='ignore')
================================================================================
my 'stock_universe' contains about 1,200 stocks, some example stocks are like:
[Equity(2, symbol=u'ARNC', asset_name=u'ARCONIC INC', exchange=u'NYSE', start_date=u'Tue, 01 Jan 2002 00:00:00 GMT', end_date=u'Mon, 03 Apr 2017 00:00:00 GMT', first_traded=None, auto_close_date=u'Thu, 06 Apr 2017 00:00:00 GMT', exchange_full=u'NEW YORK STOCK EXCHANGE'),
Equity(48487, symbol=u'EURN', asset_name=u'EURONAX SA', exchange=u'NYSE', start_date=u'Fri, 23 Jan 2015 00:00:00 GMT', end_date=u'Mon, 03 Apr 2017 00:00:00 GMT', first_traded=None, auto_close_date=u'Thu, 06 Apr 2017 00:00:00 GMT', exchange_full=u'NEW YORK STOCK EXCHANGE'),
...
...]
================================================================================
The error and call stack I am getting is as follows:
TypeErrorTraceback (most recent call last)
in ()
----> 1 price_df = get_pricing(stock_universe)
/build/src/qexec_repo/qexec/research/api.py in get_pricing(symbols, start_date, end_date, symbol_reference_date, frequency, fields, handle_missing)
229 asset_data_dir=asset_data_dir,
230 findata_dir=findata_dir,
--> 231 user_id=user_id,
232 )
233
/build/src/qexec_repo/qexec/research/api.pyc in inner_get_pricing(symbols, start_date, end_date, symbol_reference_date, frequency, fields, handle_missing, asset_data_dir, findata_dir, user_id)
635
636 assetspecific_data = get_pricing_internal(
--> 637 data_portal, assets, pinchedstart, pinched_end, frequency, fields,
638 )
639
/build/src/qexec_repo/qexec/research/trades.pyc in get_pricing_internal(data_portal, assets, start_date, end_date, frequency, fields)
102 start_date=ensure_timestamp(startdate),
103 end_date=ensure_timestamp(end_date),
--> 104 data_frequency=frequency,
105 )
/build/src/qexec_repo/qexec/sources/ohlcv_panel.pyc in ohlcv_panel_from_source(data_portal, sids, start_date, end_date, date_index, data_frequency, fields)
100 len(query_index),
101 freq,
--> 102 _field)
103 # For date_indexes which extend past the last available dt, reindex
104 # to provide nans after the last available dt.
/build/src/qexec_repo/zipline_repo/zipline/data/data_portal.pyc in get_history_window(self, assets, end_dt, bar_count, frequency, field, ffill)
946 dt=last_traded,
947 perspective_dt=history_end,
--> 948 data_frequency=data_frequency,
949 )
950 )
/build/src/qexec_repo/zipline_repo/zipline/data/data_portal.pyc in get_adjusted_value(self, asset, field, dt, perspective_dt, data_frequency, spot_value)
641 else:
642 spot_value = self.get_spot_value(asset, field, dt,
--> 643 data_frequency)
644
645 if isinstance(asset, Equity):
/build/src/qexec_repo/zipline_repo/zipline/data/data_portal.pyc in get_spot_value(self, assets, field, dt, data_frequency)
526
527 if assets_is_scalar:
--> 528 return get_single_asset_value(assets)
529 else:
530 return list(map(get_single_asset_value, assets))
/build/src/qexec_repo/zipline_repo/zipline/data/data_portal.pyc in get_single_asset_value(asset)
494 raise KeyError("Invalid column: " + str(field))
495
--> 496 if dt < asset.start_date or \
497 (data_frequency == "daily" and
498 session_label > asset.end_date) or \
pandas/tslib.pyx in pandas.tslib.Timestamp.richcmp_ (pandas/tslib.c:18619)()
TypeError: Cannot compare type 'Timestamp' with type 'unicode'
================================================================================
BTW, it didn't give me error if I simply load a symbol like this:
price_df = get_pricing('MSFT', start_date = time_range[0], end_date = time_range[-1])
I am guessing the error is because of some broken data for some of the stocks in my 'stock_universe' within the given time period.
How am I able to get rid of this and load the price data? Many thanks!