From 000b64703aef617edbe088e9d6dd4351fcdba082 Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Wed, 22 Jun 2016 18:05:54 -0400 Subject: [PATCH] BUG: Fixes quandl bundle failing to download pricing data for invalid symbol --- zipline/data/bundles/quandl.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zipline/data/bundles/quandl.py b/zipline/data/bundles/quandl.py index 2d22b623..dcb08d88 100644 --- a/zipline/data/bundles/quandl.py +++ b/zipline/data/bundles/quandl.py @@ -17,6 +17,8 @@ from zipline.utils.cli import maybe_show_progress log = Logger(__name__) seconds_per_call = (pd.Timedelta('10 minutes') / 2000).total_seconds() +# Invalid symbols that quandl has had in its metadata: +excluded_symbols = frozenset({'TEST123456789'}) def _fetch_raw_metadata(api_key, cache, retries, environ): @@ -116,6 +118,8 @@ def fetch_symbol_metadata_frame(api_key, 'oldest_available_date': 'start_date', 'newest_available_date': 'end_date', }).sort('symbol') + + data = data[~data.symbol.isin(excluded_symbols)] # cut out all the other stuff in the name column # we need to escape the paren because it is actually splitting on a regex data.asset_name = data.asset_name.str.split(r' \(', 1).str.get(0)