BUG: Fix exception on no symbol with fuzzy enabled

If there is no symbol there should be no fuzzy lookup either.
This commit is contained in:
Eddie Hebert
2015-07-15 15:52:33 -04:00
parent ace2b5c9e9
commit 376dc7b703
+5 -2
View File
@@ -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,