mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-06 13:00:45 +08:00
BUG: Convert sqlalchemy RowProxy to dict for assignment
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user