Commit f115fbc3 authored by Dr.李's avatar Dr.李

fixed bug when input excluded is none

parent bde6315a
...@@ -462,7 +462,11 @@ class SqlEngine(object): ...@@ -462,7 +462,11 @@ class SqlEngine(object):
) )
risk_cov = pd.read_sql(query, self.engine).sort_values('FactorID') risk_cov = pd.read_sql(query, self.engine).sort_values('FactorID')
risk_exposure_cols = [FullFactor.__table__.columns[f] for f in total_risk_factors if f not in set(excluded)] if excluded:
risk_exposure_cols = [FullFactor.__table__.columns[f] for f in total_risk_factors if f not in set(excluded)]
else:
risk_exposure_cols = [FullFactor.__table__.columns[f] for f in total_risk_factors]
query = select([FullFactor.code, special_risk_col] + risk_exposure_cols) \ query = select([FullFactor.code, special_risk_col] + risk_exposure_cols) \
.where(and_(FullFactor.trade_date == ref_date, FullFactor.code.in_(codes))).distinct() .where(and_(FullFactor.trade_date == ref_date, FullFactor.code.in_(codes))).distinct()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment