From 376dc7b703d96f644d6354502b32a7cf5579917f Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Wed, 15 Jul 2015 15:52:33 -0400 Subject: [PATCH] BUG: Fix exception on no symbol with fuzzy enabled If there is no symbol there should be no fuzzy lookup either. --- zipline/assets/assets.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zipline/assets/assets.py b/zipline/assets/assets.py index 4365da37..19985319 100644 --- a/zipline/assets/assets.py +++ b/zipline/assets/assets.py @@ -750,8 +750,11 @@ class AssetFinder(object): # Build an Asset of the appropriate type, default to Equity asset_type = entry.pop('asset_type', 'equity') if asset_type.lower() == 'equity': - fuzzy = entry['symbol'].replace(self.fuzzy_char, '') \ - if self.fuzzy_char else None + try: + fuzzy = entry['symbol'].replace(self.fuzzy_char, '') \ + if self.fuzzy_char else None + except KeyError: + fuzzy = None asset = Equity(**entry) c = self.conn.cursor() t = (asset.sid,