aboutsummaryrefslogtreecommitdiffstats
path: root/python/intex/intex_scenarios.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/intex/intex_scenarios.py')
-rw-r--r--python/intex/intex_scenarios.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/intex/intex_scenarios.py b/python/intex/intex_scenarios.py
index d28ec5cb..ddb9e9c2 100644
--- a/python/intex/intex_scenarios.py
+++ b/python/intex/intex_scenarios.py
@@ -41,8 +41,8 @@ def get_reinv_assets(conn, dealname, workdate):
def get_recovery(conn, dealname, workdate, defaultrecovery=50):
""" compute average price of defaulted assets """
- sqlstr = "select sum(coalesce(price, %s) * currentbalance)/sum(currentbalance) " + \
- "from et_aggdealinfo_historical(%s, %s) where defaultedflag is True"
+ sqlstr = ("select sum(coalesce(price, %s) * currentbalance)/sum(currentbalance) AS recov "
+ "from et_aggdealinfo_historical(%s, %s) where defaultedflag is True")
with conn.cursor() as c:
try:
c.execute(sqlstr, (defaultrecovery, dealname, workdate))