diff options
Diffstat (limited to 'python/load_intex_collateral.py')
| -rw-r--r-- | python/load_intex_collateral.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/python/load_intex_collateral.py b/python/load_intex_collateral.py index 5452335c..3f359e6a 100644 --- a/python/load_intex_collateral.py +++ b/python/load_intex_collateral.py @@ -43,22 +43,20 @@ def upload_data(conn, dealnames, workdate): for line in dr: for f in missingfields: line[f] = None - try: - line['Fixed or Float'] = line['Fixed or Float'].upper() + if line['LoanX ID']: line['LoanX ID'] = line['LoanX ID'].upper() - line['CUSIP'] = line['CUSIP'].upper() - line['Asset Subtype'] = line['Asset Subtype'].replace("Reinvest ", "") - line['Asset Subtype'] = line['Asset Subtype'].replace("Reinv ", "") - except AttributeError: - pass - else: - #sanity checks for loanxid and cusip if len(line['LoanX ID']) > 8: logging.warning("dubious id found: {0}".format(line['LoanX ID'])) line['LoanX ID'] = line['LoanX ID'][:8] + if line['Fixed or Float']: + line['Fixed or Float'] = line['Fixed or Float'].upper() + if line['CUSIP']: + line['CUSIP'] = line['CUSIP'].upper() if len(line['CUSIP']) > 9: logging.warning("dubious CUSIP found: {0}".format(line['CUSIP'])) line['CUSIP'] = line['CUSIP'][:9] + if line['Asset Subtype']: + line['Asset Subtype'] = line['Asset Subtype'].replace("Reinvest ", "").replace("Reinv ","") if len(line['Asset Subtype'])>10: line['Asset Subtype'] = line['Asset Subtype'][:9] |
