From b9e4b62374dfaaf5e50321f79ee80e4371e325a8 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Thu, 12 Nov 2015 16:22:47 -0500 Subject: [PATCH] PERF: Fewer conversions in _convert_row_to_equity. --- zipline/assets/assets.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zipline/assets/assets.py b/zipline/assets/assets.py index a23c32fd..817195da 100644 --- a/zipline/assets/assets.py +++ b/zipline/assets/assets.py @@ -900,14 +900,11 @@ class AssetFinderCachedEquities(AssetFinder): fuzzy_symbol, [] ).append(asset) - def _convert_row_to_equity(self, equity): + def _convert_row_to_equity(self, row): """ Converts a SQLAlchemy equity row to an Equity object. """ - data = dict(equity.items()) - _convert_asset_timestamp_fields(data) - asset = Equity(**data) - return asset + return Equity(**_convert_asset_timestamp_fields(dict(row))) def _get_fuzzy_candidates(self, fuzzy_symbol): if fuzzy_symbol in self.fuzzy_symbol_hashed_equities: