From 847b5bdc4294cd3323be529977352d6c6434943b Mon Sep 17 00:00:00 2001 From: jfkirk Date: Fri, 12 Jun 2015 15:54:52 -0400 Subject: [PATCH] BUG: The 'file_name' metadata arg now overwrites 'symbol', if it is given This is to fix the issue where 'GOOG_L's metadata lists its symbol as 'GOOG'. To resolve this, the 'file_name' is used as the canonical symbol, if it is given. --- zipline/assets/assets.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/zipline/assets/assets.py b/zipline/assets/assets.py index c2483a2f..e2d2678b 100644 --- a/zipline/assets/assets.py +++ b/zipline/assets/assets.py @@ -267,13 +267,9 @@ class AssetFinder(object): # Update the metadata object with the new sid self.insert_metadata(identifier=identifier, sid=kwargs['sid']) - # If the file_name is in the kwargs, it may be the symbol + # If the file_name is in the kwargs, it will be used as the symbol try: - file_name = kwargs.pop('file_name') - try: - kwargs['symbol'] - except KeyError: - kwargs['symbol'] = file_name + kwargs['symbol'] = kwargs.pop('file_name') except KeyError: pass