From 8056dd8a90a4e4e39bc202c224a3654e23ad28c2 Mon Sep 17 00:00:00 2001 From: kglowinski Date: Thu, 1 Sep 2016 13:54:24 -0400 Subject: [PATCH] BUG: Fixing SymbolNotFound to be raised. --- zipline/assets/assets.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zipline/assets/assets.py b/zipline/assets/assets.py index 91f114f6..08c481e3 100644 --- a/zipline/assets/assets.py +++ b/zipline/assets/assets.py @@ -648,7 +648,7 @@ class AssetFinder(object): if not options: # no equity owned the fuzzy symbol on the date requested - SymbolNotFound(symbol=symbol) + raise SymbolNotFound(symbol=symbol) if len(options) == 1: # there was only one owner, return it @@ -703,6 +703,10 @@ class AssetFinder(object): there are multiple candidates for the given ``symbol`` on the ``as_of_date``. """ + if symbol is None: + raise TypeError("Cannot lookup symbol of type NoneType for " + "as of date %s" % as_of_date) + if fuzzy: return self._lookup_symbol_fuzzy(symbol, as_of_date) return self._lookup_symbol_strict(symbol, as_of_date)