BUG: Convert sqlalchemy RowProxy to dict for assignment

This commit is contained in:
Stewart Douglas
2015-09-10 11:53:25 -04:00
committed by jfkirk
parent 46346ecb5d
commit 4300ab357a
+4
View File
@@ -177,6 +177,8 @@ class AssetFinder(object):
pass
data = self.select_equity_by_sid(sid).execute().fetchone()
# Convert 'data' from a RowProxy object to a dict, to allow assignment
data = dict(data.items())
if data:
if data['start_date']:
data['start_date'] = pd.Timestamp(data['start_date'], tz='UTC')
@@ -205,6 +207,8 @@ class AssetFinder(object):
pass
data = self.select_future_by_sid(sid).execute().fetchone()
# Convert 'data' from a RowProxy object to a dict, to allow assignment
data = dict(data.items())
if data:
if data['start_date']:
data['start_date'] = pd.Timestamp(data['start_date'], tz='UTC')